Murtaza Mehmood
Murtaza Mehmood

Reputation: 104

Nested Scroll inside UIViewController

I want to make a screen where user can have a design like a scrollview with two UIView on top and then below these views there can be a collectionview because user can scroll collectionview cell horizontally with paging and inside UICollectionViewCell there's UITableView inside. size of collectionview should be the size of SafeArea and if user start scroll using pan gesture whether his finger on scrollview or tableview, UIscrollview should scroll until the top edge of collectionview touches the top edge of scrollview and UIScrollView stop scrolling and without releasing pan gesture tableview Inside UICollectionViewCell should start scrolling and same for scrolling downward when tableview scroll to top and after then uiscrollview start scrolling without releasing fingers from screen. I'm attaching the screen design hierarchy. I don't want much code I just want how to shift scroll swipe gesture from UIScrollView to UItableview with single interaction.

Storyboard ScreenShot

Document outline view

Upvotes: -2

Views: 132

Answers (1)

Muhammad Nawaz
Muhammad Nawaz

Reputation: 1163

you can achieve your goal with tableView if you want to scroll the view and the table cell with single touch on complete screen. you need to use your top views as UITableViewCell and you can load this cell with 2 different tableView Sections. in first section load your static views and in 2nd section you can load you rest of the cell items.

with this way you don't need to append you View with ScrollView

Upvotes: 2

Related Questions