Visual Format Language
let constraints = NSLayoutConstraint.constraintsWithVisualFormat(
"|-[myView]-|",
options:.AlignAllTop , metrics: nil,
views: ["myView" : myView])
NSLayoutConstraint.activateConstraints(constraints)
» "|-[myView]-|" : ΤϥʔϩάͰΑ͘ݟ͔͚ΔΞϨ
» ੍ͷจ๏ΛίϯύΠϥ͕νΣοΫͯ͘͠Εͳ͍
Slide 10
Slide 10 text
NSLayoutAnchor
myView.leftAnchor
.constraintEqualToAnchor(view.layoutGuides.leftAnchor)
.active = true
» iOS 9 and later / OS X 10.11 and later
» ͕݅߹͏ͳΒɺΘΓͱΞϦͩͱࢥ͏ͷͰݕ౼͍ͨ͠
Slide 11
Slide 11 text
ͬͱ͍͍खஈ͕ͳ͍͔ʁ
» ඪ४ͷํ๏Ͱॻ͖ʹ͍͘ͷ͕ݱঢ়
» Auto Layout ΛίʔυͰॻ͘ͳɺͱݴΘΕͯෆࢥٞͰͳ͍
Slide 12
Slide 12 text
SnapKit
Slide 13
Slide 13 text
SnapKit
» http://snapkit.io/
» Auto Layout Library
» For Swift 2
» ެࣜͰ Auto Layout DSL ͱݴ͍ͬͯΔ͕ɺSwift ͷจ๏ͦͷͷ