April 2020
Beginner
316 pages
8h 20m
English
First introduced in iOS 8, UIStackView was welcomed with open arms as it allowed for a more flexible layout hierarchy than what was on offer before. UIStackViews allow us to implement vertical and horizontal stacking of independent views without getting bogged down in the complexity of a UITableView or a UICollectionView:
let viewOne = UIView()let viewTwo = UIView()let stackView = UIStackView(arrangedSubviews: [viewOne, viewTwo])stackView.axis = .verticalstackView.distribution = .fillEqually
The preceding snippet of code is how you would programmatically build a UIStackView.
Read now
Unlock full access