mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-11 05:45:56 +10:00
rename touch actions; better comment
This commit is contained in:
@@ -343,18 +343,18 @@ extension FeedsViewController: UITableViewDataSource, UITableViewDelegate {
|
||||
self?.performSegueWithIdentifier("showFeedMedia", sender: info)
|
||||
}
|
||||
|
||||
// simulate select effects when tap on cell.mediaCollectionView's space part
|
||||
// simulate select effects when tap on messageTextView or cell.mediaCollectionView's space part
|
||||
|
||||
cell.mediaCollectionViewTouchesBeganAction = { [weak self] in
|
||||
cell.touchesBeganAction = { [weak self] in
|
||||
self?.tableView(tableView, willSelectRowAtIndexPath: indexPath)
|
||||
tableView.selectRowAtIndexPath(indexPath, animated: false, scrollPosition: .None)
|
||||
}
|
||||
cell.mediaCollectionViewTouchesEndedAction = { [weak self] in
|
||||
cell.touchesEndedAction = { [weak self] in
|
||||
delay(0.03) {
|
||||
self?.tableView(tableView, didSelectRowAtIndexPath: indexPath)
|
||||
}
|
||||
}
|
||||
cell.mediaCollectionViewTouchesCancelledAction = {
|
||||
cell.touchesCancelledAction = {
|
||||
tableView.deselectRowAtIndexPath(indexPath, animated: true)
|
||||
}
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@ class FeedCell: UITableViewCell {
|
||||
var tapAvatarAction: (() -> Void)?
|
||||
var tapMediaAction: ((transitionView: UIView, imageURL: NSURL) -> Void)?
|
||||
|
||||
var mediaCollectionViewTouchesBeganAction: (() -> Void)?
|
||||
var mediaCollectionViewTouchesEndedAction: (() -> Void)?
|
||||
var mediaCollectionViewTouchesCancelledAction: (() -> Void)?
|
||||
var touchesBeganAction: (() -> Void)?
|
||||
var touchesEndedAction: (() -> Void)?
|
||||
var touchesCancelledAction: (() -> Void)?
|
||||
|
||||
var attachmentURLs = [NSURL]() {
|
||||
didSet {
|
||||
@@ -96,24 +96,24 @@ class FeedCell: UITableViewCell {
|
||||
avatarImageView.addGestureRecognizer(tapAvatar)
|
||||
|
||||
messageTextView.touchesBeganAction = { [weak self] in
|
||||
self?.mediaCollectionViewTouchesBeganAction?()
|
||||
self?.touchesBeganAction?()
|
||||
}
|
||||
messageTextView.touchesEndedAction = { [weak self] in
|
||||
self?.mediaCollectionViewTouchesEndedAction?()
|
||||
self?.touchesEndedAction?()
|
||||
}
|
||||
messageTextView.touchesCancelledAction = { [weak self] in
|
||||
self?.mediaCollectionViewTouchesCancelledAction?()
|
||||
self?.touchesCancelledAction?()
|
||||
}
|
||||
|
||||
let backgroundView = TouchClosuresView(frame: mediaCollectionView.bounds)
|
||||
backgroundView.touchesBeganAction = { [weak self] in
|
||||
self?.mediaCollectionViewTouchesBeganAction?()
|
||||
self?.touchesBeganAction?()
|
||||
}
|
||||
backgroundView.touchesEndedAction = { [weak self] in
|
||||
self?.mediaCollectionViewTouchesEndedAction?()
|
||||
self?.touchesEndedAction?()
|
||||
}
|
||||
backgroundView.touchesCancelledAction = { [weak self] in
|
||||
self?.mediaCollectionViewTouchesCancelledAction?()
|
||||
self?.touchesCancelledAction?()
|
||||
}
|
||||
mediaCollectionView.backgroundView = backgroundView
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user