Guest User

Untitled

a guest
Jan 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. class MyCollectionView: UICollectionView, UIGestureRecognizerDelegate {
  2.  
  3. func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
  4. return true
  5. }
  6. }
  7.  
  8. func setupCollection() {
  9. cellSize = CGSize(width: self.view.frame.width, height: self.view.frame.width)
  10. collectionView.delegate = self
  11. collectionView.dataSource = self
  12. if let layout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout {
  13. layout.scrollDirection = .horizontal
  14. }
  15. //collectionView.isScrollEnabled = false
  16. collectionView.isPagingEnabled = true
  17. collectionView.alwaysBounceVertical = false
  18. }
Add Comment
Please, Sign In to add comment