1

iMessage has the ability to swipe between apps by panning left or right. This presents new view controller, when swiping far/fast enough. My issue is that while swiping to a new app, the stickers in my collectionView are scrolling up and down if I move my finger vertically at all. I want the stickers to stay in place as I am panning from one app to the next.

Here is an example of what I mean:

(click the image to see gif...)

scroll while swiping

Here is what I tried that didn't quite work for me:

//using the scrollViewDelegate
override func scrollViewDidScroll(_ scrollView: UIScrollView) {
    if scrollView.contentOffset.x != 0 {
        scrollView.isScrollEnabled = false
    }
}

^ this would work, but disables scrolling until the view is loaded again or the user drags left or right. So not at all a solution.

Jake Dobson
  • 1,716
  • 3
  • 11
  • 29

0 Answers0