Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Swiftで作るiOSアプリ開発入門_03
Search
jollyjoester
February 20, 2016
Education
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Swiftで作るiOSアプリ開発入門_03
Schoo講義資料
jollyjoester
February 20, 2016
More Decks by jollyjoester
See All by jollyjoester
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
印西市創業実践プログラム2026 【AI活用講座】
jollyjoester
0
66
AI時代でも変わらない技術コミュニティの力 ~10年続く"ゆるい"つながりが生み出す価値~
jollyjoester
0
37
AIコードアシスタントとiOS開発
jollyjoester
1
390
市民のためのセキュリティ講座
jollyjoester
0
120
コミュニティMTG in WWDC24
jollyjoester
0
390
BengaluruでLTしてきた
jollyjoester
0
420
try! Swift Tokyo 2024
jollyjoester
0
420
エンジニアが直接会う場の価値について
jollyjoester
8
4.7k
Other Decks in Education
See All in Education
2026年度春学期 統計学 第11回 分布の「型」を考える - 確率分布モデルと正規分布 (2026. 6. 11)
akiraasano
PRO
0
180
CLASSIFICATION OF CRUDE DRUGS
pawan5505
0
180
1人 × AI、1か月でここまで作れる ー 数年前の外注換算3.8〜7.4億円・241〜379人月分の作業を、AI費用 約10万円・31日で
frievea
0
480
25-26 CBT Library top items
cbtlibrary
0
250
学生のうちに考えておきたい信頼の話
suisan
1
780
【新規入学者様】ZEPメタバース校舎ガイド
ainischool
0
140
Tema 1. El relieve de España: Formación y características
juanmartin2026
0
6.4k
FA26 CLU MS Clinical Psychology New Student Orientation
jdbedics
0
170
Comentario del plano urbano de Madrid hasta 1860 (1ª parte )
juanmartin2026
1
71k
私たちはなんでテストするんだっけ? Ver.東北IT物産展2026 in 会津若松
camel_404
3
190
2026年度春学期 統計学 第15回 分布についての仮説を検証する ― 仮説検定(2) (2026. 7. 9)
akiraasano
PRO
0
130
焦燥を平穏に変えるエンジニアのための哲学
ichimichi
7
6.8k
Featured
See All Featured
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
690
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
240
Tell your own story through comics
letsgokoyo
1
1.1k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Paper Plane (Part 1)
katiecoart
PRO
1
11k
Rails Girls Zürich Keynote
gr2m
96
14k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
420
A designer walks into a library…
pauljervisheath
211
25k
A Soul's Torment
seathinner
7
3.6k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
390
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ϒϩά࿈ࡌ࢝Ί·ͨ͠ʂ