13
UIStackView and Auto Layout

UIStackView and Auto Layout

Embed Size (px)

Citation preview

UIStackView and Auto Layout

Who am I?@jeffsukeMobile App Developer

Blog

Jeffsuke is not a pen.https://github.com/jeffsuke

WWDC Tips» No Keynote but Live viewing

» Platforms State of the Union is for us

» Code and Go to Lab

» Join Hackathon afterwords

UIStackView?New UIView subclass let you align views in either a column or a row.Easy to build, maintain. Lightweight.

iOS Developer Library — Pre-Release

What can you do with it» Axis

» Alignment(Leading, trailing...)

» Distribution(Fill Equaly, Fill Propotionally...)

» Spacing

iOS Developer Library — Pre-Release

How UIStackView WorksUsing Auto Layout. We can create similar container with Xcode 6.

Fake UIStackView on Xcode 6

Compression ResistanceHow much the view doesn't want to shrink.

Intrinsic Content SizeUILabel, UIButton, UIImage and etc. have Intrinsic content size.Resize dynamically.

PrioritySince UIStackView depends on Auto Layout, Manipulating priority will change the layout.Especialy if the priority is smalar than

UILayoutPriorityFittingSizeLevel = 50

Wider Stack ViewUsing UILayoutGuide or UIView, it will give you more flexibility.

Stick to Window SizeMore Extensibility with Auto Layout.

Gatta work on Auto Layout

DEMO