iOS Programming Cookbook
上QQ阅读APP看书,第一时间看更新

Working with stack views

UIStackView is one of the coolest features introduced in iOS 9.0 for developers. It was a hassle to arrange groups of views horizontally or vertically. You had to get your hands dirty with a lot of Auto Layout constraints to arrange these views properly. UIStackView makes arranging subviews horizontally or vertically easier without you worrying about Auto Layout. Although you don't need to use Auto Layout to arrange your views, as its UIStackview's job, you still need to use Auto Layout to define position and size of the stack view itself. If you're still not convinced about the magic that UIStackView does, you have to give it a shot.