The Only UIStackView Guide You Will Ever Need

Swerve Auto Layout

Image for post
Image for post
Photo by Kimberly Farmer on Unsplash

Prerequisites:

Terminology

Playing with the properties

axis

Image for post
Image for post

Spacing and distribution

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Stackview basics

Add arranged subview

Remove subviews

for item in stack.arrangedSubviews {
stack.removeArrangedSubview(item)
}
stack.arrangedSubviews.forEach{ element in
stack.removeArrangedSubview(element)
}

Conclusion:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store