ScrollViews-Demo
There is 3 types of Scrollable Views
- UIScrollView
- UICollectionView
- UITableView
Each has Pros and Cons
UIScrollView
- It is needed first to pin the scroll view to the parent VC with its 4 edges
- And second to pin whatever’s inside the scroll view to scroll view itself, below it is the stack view
UICollectionView
UITableView
Pros & Cons
UIScrollView (Common)
π₯ Pros
- Make anything scrollable
- Minimalist
- Full Control
- Good for long pages
π§πΏ Cons
- Cant easly reload
- No built affordances (i.e. pull to refresh)
- Auto Layout more complex
UICollectionView (Rare)
π Pros
- Customizable layouts
- Multi-column scrollable
- Can dynamically change layout
- Good for photos in a grid
π€Ύπ» Cons
- More complex
- Often overkill
UITableView (All The Time!)
π Pros
- Highly preformant (reuseIdentifiers)
- Many affordances built in (headers, footers, sections)
- Perfect for single column lists
ππΌ Cons
- Hard to do complex non-single column layouts