Skip to content

Commit

Permalink
Merge pull request #310 from raisaanjani92/shouldShowMenuForItemAt
Browse files Browse the repository at this point in the history
Use optional in collectionView:shouldShowMenuForItemAtIndexPath:
  • Loading branch information
AntonPalich authored May 30, 2017
2 parents c2b378d + dd421e7 commit 0eb7ac5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ extension BaseChatViewController: ChatCollectionViewLayoutDelegate {
}

@objc(collectionView:shouldShowMenuForItemAtIndexPath:)
open func collectionView(_ collectionView: UICollectionView, shouldShowMenuForItemAt indexPath: IndexPath) -> Bool {
open func collectionView(_ collectionView: UICollectionView, shouldShowMenuForItemAt indexPath: IndexPath?) -> Bool {
// Note: IndexPath set optional due to https://github.com/badoo/Chatto/issues/310
// Might be related: https://bugs.swift.org/browse/SR-2417
guard let indexPath = indexPath else { return false }
return self.presenterForIndexPath(indexPath).shouldShowMenu()
}

Expand Down

0 comments on commit 0eb7ac5

Please sign in to comment.