Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Swiftで作るiOSアプリ開発入門_03
Search
jollyjoester
February 20, 2016
Education
0
110
Swiftで作るiOSアプリ開発入門_03
Schoo講義資料
jollyjoester
February 20, 2016
Tweet
Share
More Decks by jollyjoester
See All by jollyjoester
市民のためのセキュリティ講座
jollyjoester
0
28
コミュニティMTG in WWDC24
jollyjoester
0
290
BengaluruでLTしてきた
jollyjoester
0
330
try! Swift Tokyo 2024
jollyjoester
0
320
エンジニアが直接会う場の価値について
jollyjoester
8
4.3k
来年Proposalを出すつもりで参加するときっともっと楽しい!
jollyjoester
0
350
My favorite sessions in WWDC 23
jollyjoester
0
640
みんなでAIと戯れよう
jollyjoester
0
150
続く勉強会の作り方
jollyjoester
2
860
Other Decks in Education
See All in Education
2025年度春学期 統計学 第4回 データを「分布」で見る (2025. 5. 1)
akiraasano
PRO
0
110
2025年度春学期 統計学 第10回 分布の推測とは ー 標本調査,度数分布と確率分布 (2025. 6. 12)
akiraasano
PRO
0
150
プレゼンテーション実践
takenawa
0
6.6k
Gaps in Therapy in IBD - IBDInnovate 2025 CCF
higgi13425
0
500
日本の教育の未来 を考える テクノロジーは教育をどのように変えるのか
kzkmaeda
1
210
ふりかえり研修2025
pokotyamu
0
1.2k
登壇未経験者のための登壇戦略~LTは設計が9割!!!~
masakiokuda
3
550
i-GIP 2025 中高生のみなさんへ資料
202200
0
500
Constructing a Custom TeX Ecosystem for Educational Institutions—Beyond Academic Typesetting
doratex
1
10k
20250611_なんでもCopilot1年続いたぞ~
ponponmikankan
0
100
Tutorial: Foundations of Blind Source Separation and Its Advances in Spatial Self-Supervised Learning
yoshipon
1
120
20250625_なんでもCopilot 一年の振り返り
ponponmikankan
0
230
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
BBQ
matthewcrist
89
9.7k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Building Adaptive Systems
keathley
43
2.7k
How STYLIGHT went responsive
nonsquared
100
5.6k
Faster Mobile Websites
deanohume
307
31k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
A better future with KSS
kneath
238
17k
Scaling GitHub
holman
460
140k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Docker and Python
trallard
44
3.5k
Transcript
SwiftͰ࡞Δ iOSΞϓϦ։ൃೖ ̏ݶɿAutoLayoutͰΞϓϦͷݟͨΛ͑Δ 1
ࣗݾհ ࣣౡҒ೭ʢͳͳ͠·ͻͰΏ͖ʣ Reproגࣜձࣾ iPhoneΞϓϦ։ൃ͕͖ 2
ࣗݾհ 3 https://repro.io
ຊίʔεͷඪ ۤΛΓӽ͑ͯ ָ͘͠ΞϓϦ։ൃͰ͖ΔΑ͏ʹͳΔʂ 4
෭ڭࡐ վగ൛ No.1εΫʔϧߨࢣਞʹΑΔ ੈքҰड͚͍ͨ iPhoneΞϓϦ։ൃͷतۀ (ٕज़ධࣾ) 5
ࠓճͷतۀͷඪ AutoLayoutͷ͍ํΛମͰ֮͑Δʂ 6
तۀͷલఏ݅ • ͓खݩͷMacʹXcode(version7.0Ҏ্)͕Πϯετʔ ϧ͞Ε͍ͯΔ͜ͱ • ̎ݶͰ࡞ͬͨϓϩδΣΫτΛ༻ҙ͢Δ 7
ຊͷϝχϡʔ • AutoLayoutͷׂ • AutoLayoutͷઃఆͷํ • AutoLayoutͷ͍ํͷ࿅श 8
AutoLayoutͷׂ 9
AutoLayoutͱԿ͔ʁ ΞϓϦέʔγϣϯͷϢʔβΠϯλʔϑΣΠε ʢಛʹը໘ϨΠΞτʣΛ࡞͢ΔγεςϜ ͭ·ΓݟͨΛ࡞ΔͨΊͷͷ 10
AutoLayoutҎલ • ViewͷαΠζ࠲ඪΛͰࢦఆ • AutoSizingʢView͔Βͷج४ʣ 11
AutoLayoutԿ͕͍͍ͷ͔ʁ ը໘ͷେ͖͖͞ɺҬઃఆʢݴޠͳ Ͳʣͷҧ͍ʹԠͯ͡ಈతʹมԽ͢Δɺ൚ ༻తͳը໘ϨΠΞτΛ࡞Γग़͢͜ͱ͕ Ͱ͖Δʂ 12
AutoLayoutͷઃఆͷํ ·ͣͱʹ͔ͬͯ͘ΈΔ 13
ݱঢ়ͷϓϩδΣΫτ֬ೝ 14 • iPhone5sͱiPhone6PlusͰݟͨΛ ‣ γϛϡϨʔλʔͰ֬ೝ ‣ Assistant EditorͷpreviewͰ֬ೝ
ݱঢ়ͷϓϩδΣΫτ֬ೝ 15 • iPhone5sͱiPhone6PlusͰݟͨΛ ‣ γϛϡϨʔλʔͰ֬ೝ ‣ Assistant EditorͷpreviewͰ֬ೝ
Previewͷ։͖ํ 16
Previewͷ։͖ํ 17
େ͖͍ͩͱࠨ্ʹدΔ 18
ը૾ΛਅΜதʹஔ͢Δ ʢConstraintsઃఆʣ 19
ը૾ΛਅΜதʹஔ͢Δ ʢPreview֬ೝʣ 20
ϥϕϧͷҐஔΛௐ͢Δ ʢҐஔͷConstraintsઃఆʣ 21
ϥϕϧͷҐஔΛௐ͢Δ ʢαΠζͷConstraintsઃఆʣ 22
ϥϕϧͷҐஔΛௐ͢Δ ʢPreview֬ೝʣ 23
ϘλϯͷҐஔΛௐ͢Δ ʢConstraintsઃఆʣ 24 ϥϕϧͱಉ༷
ϘλϯͷҐஔΛௐ͢Δ ʢPreview֬ೝʣ 25
ԣ͖Λ֬ೝ͢Δ ʢPreview֬ೝʣ 26
ϥϕϧͷҐஔΛௐ͢Δ ʢConstraintsฤूͦͷ̍ʣ 27
ϥϕϧͷҐஔΛௐ͢Δ ʢConstraintsฤूͦͷ̎ʣ 28
ؒҧ͑ͨConstraintsΛՃͨ͠߹ ʢҟͳΔWidthΛ̎ݸઃఆʣ 29
ෆཁͳConstraintsͷআ ʢקΊʹैͬͯআʣ 30
ෆཁͳConstraintsͷআ ʢखಈͰআʣ 31
ϥϕϧΛͣΒͯ͠ΈΔ 32
Update Frames 33
Update Frames 34
Update Constraints 35
ConstraintsΛղআ 36
AutoLayoutҰཡ Align 37 Leading Edges ViewͷࠨΛἧ͑ Trailing Edges ViewͷӈΛἧ͑ Top
Edges Viewͷ্Λἧ͑ Bottom Edges ViewͷԼΛἧ͑ Holizontal Centers Viewͷԣํͷத৺ἧ͑ Vertical Centers Viewͷॎํͷத৺ἧ͑ Baselines ViewͷϕʔεϥΠϯἧ͑ Horizontal Center in Container ContainerͰࠨӈத৺ ʹஔ Vertical Center in Container ContainerͰ্Լத৺ ʹஔ
AutoLayoutҰཡ Pin 38 Spacing to nearest neighbor ͓ྡͷViewͱͷεϖʔε Width Viewͷ෯
Height Viewͷߴ͞ Equal Widths ෳͷViewΛಉ͡෯ʹ Equal Heights ෳͷViewΛಉ͡ߴ͞ʹ Aspect Ratio ViewͷॎԣൺΛݻఆ
AutoLayoutͷ͍ํ࿅श 39
࿅श༻ͷViewΛஔ͢Δ 40
࿅श༻ͷViewΛஔ͢Δ 41
ࠨԼʹݻఆ͢Δ 42
ࠨԼʹݻఆ͢Δ 43
ࠨԼʹݻఆ͢Δ 44 Update frames
͏ҰͭฒΔ 45
͏ҰͭฒΔ 46
͏ҰͭฒΔ 47
͏ҰͭฒΔ 48 Update frames
ִؒʹฒΔ 49
ִؒʹฒΔ 50
ִؒʹฒΔ 51
ִؒʹฒΔ 52
ִؒʹฒΔ 53
ִؒʹฒΔ 54
ִؒʹฒΔ 55
ִؒʹฒΔ 56
ִؒʹฒΔ 57 Update frames
ִؒʹฒΔ (Stack ViewͳΒ؆୯ɻͨͩ͠iOS9Ҏ্) 58
ִؒʹฒΔ (Stack ViewͳΒ؆୯ɻͨͩ͠iOS9Ҏ্) 59
ִؒʹฒΔ (Stack ViewͳΒ؆୯ɻͨͩ͠iOS9Ҏ্) 60
ִؒʹฒΔ (Stack ViewͳΒ؆୯ɻͨͩ͠iOS9Ҏ্) 61
ຊͷ͓͞Β͍ • ΞϓϦͷݟͨAutoLayoutͰ࡞Δ • ෦Λઃஔͯ͠Update framesΛ܁Γฦ͍ͯ͘͜͠ ͱ͕جຊʂ • AutoLayoutମͰ֮͑Δ 62
ࠂ 63 http://love-swift.connpass.com/event/25716/ ݄࣍̏Լ०ʂ
ࠂ 64 http://liginc.co.jp/?p=228155 LIGϒϩά࿈ࡌ࢝Ί·ͨ͠ʂ