mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-14 15:26:40 +10:00
guard !isTemporary to perform tapMediaAction
This commit is contained in:
@@ -201,6 +201,10 @@ class NewFeedViewController: SegueViewController {
|
||||
choosePromptLabel.hidden = (newValue != nil)
|
||||
}
|
||||
}
|
||||
|
||||
deinit {
|
||||
println("NewFeed deinit")
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
@@ -156,6 +156,10 @@ extension FeedAnyImagesCell: UICollectionViewDataSource, UICollectionViewDelegat
|
||||
|
||||
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
|
||||
|
||||
guard let firstAttachment = attachments.first where !firstAttachment.isTemporary else {
|
||||
return
|
||||
}
|
||||
|
||||
let cell = collectionView.cellForItemAtIndexPath(indexPath) as! FeedMediaCell
|
||||
|
||||
let transitionView = cell.imageView
|
||||
|
||||
@@ -93,6 +93,10 @@ class FeedBiggerImageCell: FeedBasicCell {
|
||||
|
||||
@objc private func tap(sender: UITapGestureRecognizer) {
|
||||
|
||||
guard let firstAttachment = feed?.imageAttachments?.first where !firstAttachment.isTemporary else {
|
||||
return
|
||||
}
|
||||
|
||||
if let attachments = feed?.imageAttachments {
|
||||
tapMediaAction?(transitionView: biggerImageView, image: biggerImageView.image, attachments: attachments, index: 0)
|
||||
}
|
||||
|
||||
@@ -142,6 +142,10 @@ class FeedNormalImagesCell: FeedBasicCell {
|
||||
|
||||
@objc private func tap(sender: UITapGestureRecognizer) {
|
||||
|
||||
guard let firstAttachment = feed?.imageAttachments?.first where !firstAttachment.isTemporary else {
|
||||
return
|
||||
}
|
||||
|
||||
if let imageView = sender.view as? UIImageView, index = imageViews.indexOf(imageView) {
|
||||
|
||||
if let attachments = feed?.imageAttachments {
|
||||
|
||||
Reference in New Issue
Block a user