Guest User

Untitled

a guest
Feb 25th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. class SomeViewController: UIViewController {
  2. let collectionView: UICollectionView = UICollectionView(frame: CGRect.zero, collectionViewLayout: SomeLayout())
  3.  
  4. override func viewDidLoad() {
  5. super.viewDidLoad()
  6.  
  7. let toLayout: UICollectionViewLayout = AnotherLayout()
  8.  
  9. collectionView.startInteractiveTransition(to: toLayout, completion: { [weak self] (_, _) in
  10. guard let slf = self else { return }
  11. let isInTransition = (slf.collectionView.collectionViewLayout as? UICollectionViewTransitionLayout) != nil // false
  12. })
  13. let isInTransition = (slf.collectionView.collectionViewLayout as? UICollectionViewTransitionLayout) != nil // true
  14. }
  15. }
Add Comment
Please, Sign In to add comment