3 types of Scrollable Views for iOS
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