Skip to content

Instantly share code, notes, and snippets.

@danielgalasko
Last active February 16, 2016 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielgalasko/d8c426d34c14e908ed72 to your computer and use it in GitHub Desktop.
Save danielgalasko/d8c426d34c14e908ed72 to your computer and use it in GitHub Desktop.
extension MyViewController {
func registerForPeekAndPopWithCollectionView(collectionView: UICollectionView) {
guard #available(iOS 9.0, *) else { return }
if traitCollection.forceTouchCapability == .Available {
registerForPreviewingWithDelegate(self, sourceView: collectionView)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment