0

screenshot

I am studying the Instagram profile view.

What I want is a way to pass the touch event that occurs in the collectionview to the scrollview.

I want to use the default scroll of scrollview. Because for smooth scrolling

I think it should be passed to ScrollView using ResponderChain.

Since there are many views in the collectionview, hittest is not likely to be used.

How can I pass the touch event that happened in the collectionview to the scrollview?

If you can't pass the touchevent, do you have to move and animate scrollview offset directly using Pangesture?

in collectionView code

var scrollView: UIScrollView?

override var next: UIResponder? {
        guard let scrollView = scrollView else {
            return nil
        }
        return scrollView
    }

I have failed with this code but any solution?

Thanks for viewing my question.

  • I captured this moment.

instagram screenshot

jkey
  • 3
  • 2
  • The "Instagram profile view" looks like a `UICollectionView` with a compositional layout -- unlikely the view structure / hierarchy is how you're trying to do it. – DonMag Aug 30 '22 at 12:47
  • could you take a look at that instagram screenshot? i add – jkey Aug 31 '22 at 01:10
  • and thank you for continuing to help me! – jkey Aug 31 '22 at 01:25
  • I had already looked at the Instagram profile UI -- that's why I said it looks like a `UICollectionView` with a compositional layout. Head over to Google (or your favorite search engine) and search for `swift UICollectionView Compositional Layout` and start learning. Here's ***just one*** blog post that I found in a matter of seconds that you may want to read: [Building Instagram profile screen with Compositional Layout](https://nemecek.be/blog/72/building-instagram-profile-screen-with-compositional-layout) – DonMag Aug 31 '22 at 13:06

0 Answers0