New way to go report

This commit is contained in:
kevinzhow
2015-11-03 21:29:17 +08:00
parent 51751acaa7
commit 84cca7e1dc
4 changed files with 18 additions and 45 deletions
+1 -1
View File
@@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>155</string>
<string>156</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
@@ -9,7 +9,7 @@
import UIKit
import RealmSwift
class FeedsViewController: UIViewController {
class FeedsViewController: BaseViewController {
var skill: Skill?
@@ -143,6 +143,10 @@ class FeedsViewController: UIViewController {
deinit {
print("Deinit FeedsViewControler")
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
}
override func viewDidLoad() {
super.viewDidLoad()
+11 -19
View File
@@ -35,18 +35,6 @@ class FeedCell: UITableViewCell {
var touchesBeganAction: (UITableViewCell -> Void)?
var touchesEndedAction: (UITableViewCell -> Void)?
var touchesCancelledAction: (UITableViewCell -> Void)?
var tapGesture: UITapGestureRecognizer!
func setup() {
tapGesture = UITapGestureRecognizer(target: self, action: "doTap")
}
func doTap() {
if let touchesEndedAction = touchesEndedAction {
touchesEndedAction(self)
}
}
var attachments = [DiscoveredAttachment]() {
didSet {
@@ -88,7 +76,6 @@ class FeedCell: UITableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
setup()
nicknameLabel.textColor = UIColor.yepTintColor()
messageTextView.textColor = UIColor.yepMessageColor()
distanceLabel.textColor = UIColor.grayColor()
@@ -124,6 +111,9 @@ class FeedCell: UITableViewCell {
}
messageTextView.touchesEndedAction = { [weak self] in
if let strongSelf = self {
if strongSelf.editing {
return
}
strongSelf.touchesEndedAction?(strongSelf)
}
}
@@ -140,12 +130,14 @@ class FeedCell: UITableViewCell {
}
}
backgroundView.addGestureRecognizer(tapGesture)
// backgroundView.touchesEndedAction = { [weak self] in
// if let strongSelf = self {
//// strongSelf.touchesEndedAction?(strongSelf)
// }
// }
backgroundView.touchesEndedAction = { [weak self] in
if let strongSelf = self {
if strongSelf.editing {
return
}
strongSelf.touchesEndedAction?(strongSelf)
}
}
backgroundView.touchesCancelledAction = { [weak self] in
if let strongSelf = self {
strongSelf.touchesCancelledAction?(strongSelf)
+1 -24
View File
@@ -10,29 +10,6 @@ import UIKit
class FeedTextView: UITextView {
var tapGesture: UITapGestureRecognizer!
override init(frame: CGRect, textContainer: NSTextContainer?) {
super.init(frame: frame, textContainer: textContainer)
setup()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
setup()
}
func setup() {
tapGesture = UITapGestureRecognizer(target: self, action: "doTap")
addGestureRecognizer(tapGesture)
}
func doTap() {
if let touchesEndedAction = touchesEndedAction {
touchesEndedAction()
}
}
override func canBecomeFirstResponder() -> Bool {
return false
}
@@ -48,7 +25,7 @@ class FeedTextView: UITextView {
override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {
super.touchesEnded(touches, withEvent: event)
// touchesEndedAction?()
touchesEndedAction?()
}
override func touchesCancelled(touches: Set<UITouch>?, withEvent event: UIEvent?) {