diff --git a/Yep/ViewControllers/Feeds/FeedsViewController.swift b/Yep/ViewControllers/Feeds/FeedsViewController.swift index 33353737..cbb93fae 100644 --- a/Yep/ViewControllers/Feeds/FeedsViewController.swift +++ b/Yep/ViewControllers/Feeds/FeedsViewController.swift @@ -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) } diff --git a/Yep/Views/Cells/Feed/FeedCell.swift b/Yep/Views/Cells/Feed/FeedCell.swift index cd983235..50640390 100644 --- a/Yep/Views/Cells/Feed/FeedCell.swift +++ b/Yep/Views/Cells/Feed/FeedCell.swift @@ -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 }