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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
印西市創業実践プログラム2026 【AI活用講座】
jollyjoester
0
47
AI時代でも変わらない技術コミュニティの力 ~10年続く"ゆるい"つながりが生み出す価値~
jollyjoester
0
34
AIコードアシスタントとiOS開発
jollyjoester
1
380
市民のためのセキュリティ講座
jollyjoester
0
110
コミュニティMTG in WWDC24
jollyjoester
0
390
BengaluruでLTしてきた
jollyjoester
0
410
try! Swift Tokyo 2024
jollyjoester
0
410
エンジニアが直接会う場の価値について
jollyjoester
8
4.7k
来年Proposalを出すつもりで参加するときっともっと楽しい!
jollyjoester
0
440
Other Decks in Education
See All in Education
子どものためのプログラミング道場『CoderDojo』〜法人提携例〜 / Partnership with CoderDojo Japan
coderdojojapan
PRO
4
19k
Course Review - Lecture 13 - Information Visualisation (4019538FNR)
signer
PRO
1
2.7k
形骸化しない社内勉強会の取り組み - オーナーシップの作り方 / In-house study session
soudai
PRO
0
180
!コスパよくインターンに受かる方法!
ruribou
1
320
Examen de Selectividad. Geografía junio 2026 (Convocatoria Ordinaria). UCLM
juanmartin2026
1
4.8k
Human-AI Interaction - Lecture 11 - Next Generation User Interfaces (4018166FNR)
signer
PRO
0
1.1k
Beyond the Prompt: Programming as a Pathway to Statistical Thinking
minecr
0
320
Fundamentos, Caracteristicas y Aplicaciones de los Modulos NumPy , Matplotlib y Pandas
robintux
0
200
Visionary Initiative: Materials-Positive Society — Evolving “Things,” empowering a positive society | Science Tokyo
sciencetokyo
PRO
0
190
【セーフィー】テクニカルライティング&コミュニケーション実践講座(26新卒エンジニア向け研修資料)
ymzaki_m4
0
300
Case Studies - Lecture 12 - Information Visualisation (4019538FNR)
signer
PRO
0
220
Del ojo entrenado a la visión computacional: evaluación de la severidad de enfermedades
emdelponte
0
110
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
A designer walks into a library…
pauljervisheath
211
24k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
700
Designing Powerful Visuals for Engaging Learning
tmiket
1
490
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
250
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.1k
The SEO Collaboration Effect
kristinabergwall1
1
520
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
210
So, you think you're a good person
axbom
PRO
2
2.1k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
570
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ϒϩά࿈ࡌ࢝Ί·ͨ͠ʂ