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アプリ開発入門_06
Search
jollyjoester
March 12, 2016
Education
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Swiftで作るiOSアプリ開発入門_06
Schoo講義資料
jollyjoester
March 12, 2016
Transcript
59 slides
SwiftͰ࡞Δ iOSΞϓϦ։ൃೖ 6ݶɿΞϓϦͷݟͨΛߏ͢ΔViewͷཧղ 1
ࣗݾհ ࣣౡҒ೭ʢͳͳ͠·ͻͰΏ͖ʣ Reproגࣜձࣾ iPhoneΞϓϦ։ൃ͕͖ 2
ࣗݾհ 3 https://repro.io
ຊίʔεͷඪ ۤΛΓӽ͑ͯ ָ͘͠ΞϓϦ։ൃͰ͖ΔΑ͏ʹͳΔʂ 4
෭ڭࡐ վగ൛ No.1εΫʔϧߨࢣਞʹΑΔ ੈքҰड͚͍ͨ iPhoneΞϓϦ։ൃͷतۀ (ٕज़ධࣾ) 5
ࠓճͷतۀͷඪ ViewΛֶΜͰࣗͷࢥ͍ඳ͘ ΞϓϦͷݟͨΛ࡞ΕΔΑ͏ʹ͢Δ 6
तۀͷલఏ݅ • ͓खݩͷMacʹXcode(version7.0Ҏ্)͕Πϯετʔ ϧ͞Ε͍ͯΔ͜ͱ • લճͷ͍ΞϓϦϓϩδΣΫτ͕͋ΔͱΑΓ༗ޮʹ ֶशͰ͖·͢ɻϓϩδΣΫτԼه͔Βμϯϩʔ υͰ͖·͢ɻ https://github.com/jollyjoester/Schoo-iOS-App- Development-Basic/archive/05.zip
7
ຊͷϝχϡʔ • ViewͱԿ͔ΛֶͿ • ViewͷߏΛֶͿ • ΞχϝʔγϣϯͰಈ͖ΛՃ͑Δ 8
ͦͷલʹલճͷ࣭͝ ʢ؆୯ͳ͍ΞϓϦͷاը͔Β։ൃ·ͰΛମݧʣ • teratailͰ࣭͢Δͷ༗ྉձһͱ͔ʹͳΔඞཁ͕͋Δͷ ͔ͳɻ from Kenichi Gotoh͞Μ ‣ ແྉͰ͢ʂ
https://teratail.com/ 9
ͦͷલʹલճͷ࣭͝ ʢ؆୯ͳ͍ΞϓϦͷاը͔Β։ൃ·ͰΛମݧʣ • ΞϚκϯͰߪೖ͠Α͏ͱࢥ͍ɺઌੜͷຊΛݕࡧͨ͠ͱ͜ΖɺϨ Ϗϡʔʹʮಛʹ8ষͰΘΕΔJSONσʔλΛղੳ͢Δπʔϧ ͕ɺ࣮ػςετͰக໋తͳΤϥʔΛు͖·͢ɻษڧʹͳΓ ·͕͢ɺApp StoreͰͷϦϦʔεΛࢦ͢ํɺຊॻΛߪೖ͠ ͳ͍΄͏͕ྑ͍Ͱ͠ΐ͏ɻʯͱͳ͍ͬͯͯߪೖΛ᪳ͯ͠͠· ͍·ͨ͠ɻ͜ͷղܾ͞Ε͍ͯΔͷͰ͠ΐ͏͔ʁ
from ϛϢ͞Μ ‣ ͓Βͤ͋Γ͕ͱ͏͍͟͝·͢ʂϥΠϒϥϦͷಋೖखॱʹ ෆ͕͋Γ·ͨ͠ɻ࣍ͷઃఆΛ͢Ε࣮ػͰ࣮ߦͰ͖· ͢ɻʢαϙʔταΠτͷܝࡌग़൛ࣾʹ͓ئ͍ͯ͠Έ·͢ʣ 10
ͦͷલʹલճͷ࣭͝ ʢ؆୯ͳ͍ΞϓϦͷاը͔Β։ൃ·ͰΛମݧʣ 11
ͦͷલʹલճͷ࣭͝ ʢ؆୯ͳ͍ΞϓϦͷاը͔Β։ൃ·ͰΛମݧʣ 12
ͦͷલʹલճͷ࣭͝ ʢ؆୯ͳ͍ΞϓϦͷاը͔Β։ൃ·ͰΛମݧʣ 13 • ॎɾԣ ผʑͷϨΠΞτͬͯ ग़དྷͳ͍ͷ͔ͳʁ from dig sum͞Μ
‣ SizeClassesΛͬͯͰ͖·͢ʂ
Έͳ͞·࣭͋Γ·ͨ͠Βͥͻ࣭͍ͩ͘͝͞ɻ तۀதʹऔΓ্͛ΒΕͳͯ͘ ग़དྷΔݶΓ͓͑͠·͢ʂ ͳΔ΄ͲʂͱࢥͬͨΒʮͳΔ΄ͲʯϘλϯΛ ԡ͍͚ͯͨͩ͠ΔͱྭΈʹͳΓ·͢(`ŋωŋ´) 14
ViewͱԿ͔ΛֶͿ 15
Viewͱ • ը໘Λදࣔ͢ΔͨΊͷͷ • UILabel, UIButtonͳͲ • λοϓͳͲͷΞΫγϣϯΛड͚औΔׂ 16
Viewͷछྨ ʢԿ͔Λදࣔ͢ΔͨΊͷViewʣ 17 ໊લ Ϋϥε໊ ׂ Ϗϡʔ UIView ͬͱجຊͷ෦ ϥϕϧ
UILabel จࣈΛදࣔ͢Δ ςΩετϏϡʔ UITextView จࣈͷදࣔͱฤूΛ͢Δ ΠϝʔδϏϡʔ UIImageView ը૾Λදࣔ͢Δ ϐοΧʔϏϡʔ UIPickerView બࢶͷදࣔͱબΛ͢Δ ΣϒϏϡʔ UIWebView ΣϒϖʔδΛදࣔ͢Δ
Viewͷछྨ ʢϢʔβʔ͔ΒͷΞΫγϣϯΛड͚औΔͷViewʣ 18 ໊લ Ϋϥε໊ ׂ Ϙλϯ UIButton Ϙλϯ ςΩετϑΟʔϧυ
UITextField จࣈΛೖྗ͢Δ εΠον UISwitch ΦϯͱΦϑΛ͢ΔεΠον ηάϝϯςου ίϯτϩʔϧ UISegmented Control ηάϝϯτΛબ͢Δ εςούʔ UIStepper Λ૿ͨ͠ΓݮΒͨ͠Γ͢Δ εϥΠμʔ UISlider εϥΠμʔͰΛબ
ʢ༨ஊʣUIxxxͬͯʁ • AppleͷframeworkͷΫϥε໊ʢ෦ʣʹ prefix͕͍͍ͭͯΔ ‣ CoreLocation -> CLLocationManager ‣ AVFoundation
-> AVCaptureDeviceInput ‣ UIKit -> UILabel, UIButton 19
ɹUIView • ࢛͍֯ྖҬΛද͢࠷جຊతͳView • ViewͷதʹViewΛؚΉ͜ͱ͕Ͱ͖Δ ʢContainerͱ͔ݴͬͨΓ͢Δʣ • ؚΉํͷViewSuper View ؚ·ΕΔํSub
Viewͱ͍͏ 20
ɹUIView 21
ɹUIView 22
ɹUIView 23
ɹUILabel 24 • จࣈΛදࣔ͢ΔͨΊͷView
ɹUILabel 25
UIImageView 26 • ը૾Λදࣔ͢ΔͨΊͷView
UIImageView 27
ɹUIButton 28 • ϘλϯʢλοϓΛݕ͢Δʣ
ɹUIButton 29
ɹUITextView 30
UIPickerView 31
UITextField 32
UISwitch 33 UISegmented Control UIStepper UISlider
ViewͷߏΛΔ 34
ViewͷߏΛΔ ViewͷதʹViewΛஔͯ͠ ͞ΒʹLabelΛஔͯ͠ΈΔ 35
ViewͷߏΛΔ ʢDebug View Hierarchyʣ 36
ViewͷߏΛΔ ʢDebug View Hierarchyʣ 37
ViewͷߏΛΔ ʢDocument Outlineʣ 38
ViewͷߏΛΔ ʢDocument Outlineʣ 39
ViewͷߏΛΔ ʢDocument Outlineʣ 40
ViewͷߏΛΔ ʢDocument Outlineʣ 41
ViewͷߏΛΔ ʢDocument Outlineʣ 42
ViewͷߏΛΔ ʢDocument Outlineʣ 43
ViewͷߏΛΔ ʢDocument Outlineʣ 44
ΞχϝʔγϣϯͰಈ͖ΛՃ͑Δ 45
Ξχϝʔγϣϯ ʢ·࣮ͣફ͔Βʣ • AnimalFortuneTellingϓϩδΣΫτΛ։͘ https://github.com/jollyjoester/Schoo-iOS- App-Development-Basic/archive/05.zip • ViewController.swiftΛબ 46
Ξχϝʔγϣϯ ʢϩδοΫΛϝιουʹΓग़͠ʣ 47
Ξχϝʔγϣϯ ʢanimateWithDurationʣ 48 • ·ͣԼهͷ௨Γॻ͍࣮ͯߦͯ͠ΈΔ ͍͠จ๏͕ΘΕ͍ͯΔͷͰ ·ͣߟ͑ͣʹ͓֮͑ͯ͏ʂ
Ξχϝʔγϣϯ ʢdurationʣ 49 • Ͳͷ͘Β͍ͷ࣌ؒΛ͔͚ͯΞχϝʔγϣϯΛ͢Δ͔ 1.0ඵ͔͚ؒͯΞχϝʔγϣϯΛߦ͏
Ξχϝʔγϣϯ ʢanimationsʣ 50 • Ξχϝʔγϣϯͷ݁ՌͲͷΑ͏ʹͳΔ͔ animalLabelΛ0.2ഒͷେ͖͞ʹ͢Δ
Ξχϝʔγϣϯ ʢcompletionʣ 51 • Ξχϝʔγϣϯ͕ऴΘͬͨޙʹ͢Δॲཧ ݩʹͯ͠changeLabelϝιουΛ࣮ߦ͢Δ
Ξχϝʔγϣϯ ʢresultLabelʣ 52 ΞχϝʔγϣϯதresultLabelফ͢ ݁Ռ͕ग़ͨΒදࣔ͢Δ
Ξχϝʔγϣϯ ʢanimalLabelʣ 53 animalLabelΛͩΜͩΜಁ໌ʹ͢Δ
54 ʂ
Ξχϝʔγϣϯͷछྨ 55
Ξχϝʔγϣϯ ʢ݁ՌΛৼಈͤ͞Δʣ 56 10pxҠಈͷΞχϝʔγϣϯΛ̑ճ܁Γฦ͢
ຊͷ͓͞Β͍ • Viewͷछྨ͝ͱͷ͍ํΛ֮͑Α͏ • ཱମతʹViewͷߏΛΠϝʔδͰ͖Δͱ٢ • animationΛָ͍ͬͯ͠ΞϓϦʹ͠Α͏ʂ 57
ࠂ 58 http://eventdots.jp/event/582698 ݄࣍̏̎̕ʂ
ࠂ 59 http://liginc.co.jp/series/spaceapps LIGϒϩά࿈ࡌ࢝Ί·ͨ͠ʂ
More Decks by jollyjoester
See All by jollyjoester
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
160
印西市創業実践プログラム2026 【AI活用講座】
jollyjoester
0
97
AI時代でも変わらない技術コミュニティの力 ~10年続く"ゆるい"つながりが生み出す価値~
jollyjoester
0
45
AIコードアシスタントとiOS開発
jollyjoester
1
400
市民のためのセキュリティ講座
jollyjoester
0
130
コミュニティMTG in WWDC24
jollyjoester
0
410
BengaluruでLTしてきた
jollyjoester
0
420
try! Swift Tokyo 2024
jollyjoester
0
450
エンジニアが直接会う場の価値について
jollyjoester
8
4.8k
Other Decks in Education
See All in Education
パラグラフから始めるアカデミック・ライティング
neuroiwm
3
2.8k
Session 7 - Teknik Lobby dan Negosiasi
adeputra13
0
180
2026年度秋学期 統計学 第4回 データを「分布」で見る (2026. 10. 20)
akiraasano
PRO
0
210
【2028卒向け:デザイナー就活講座】キャリアスタートセミナー_Designer Lab_長谷部 航平
koheihasebe
0
260
Unit 3: Computing Paradigms
sonakv
0
120
1002
cbtlibrary
0
530
Introduction to Primary and Secondary Metabolites their Metabolic Pathways
drpoonamkc
0
190
BRIEF OUTLINE OF IMPORTANT PLANT CONSTITUENTS
pawan_pharm
0
300
Sekolah Sabat - Triwulan 4 2026 - Pelajaran 6
hiola
0
9.3k
Liburd and Stoll Farrell "Copyright Essentials From A to AI: A 2026 NISO Training Series, Session Five: Open Movements & Author Rights"
baltimoreniso
0
190
日本における応用言語学・言語教育学これまでとこれから
terasawat
0
210
SANG PENCIPTA BERBICARA (01ABSG-Q4-2026)
ssmedikasda
0
570
Featured
See All Featured
How to build a perfect <img>
jonoalderson
1
6.2k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
30 Presentation Tips
portentint
PRO
1
470
Abbi's Birthday
coloredviolet
5
11k
Side Projects
sachag
456
43k
Evolving SEO for Evolving Search Engines
ryanjones
0
360
YesSQL, Process and Tooling at Scale
rocio
174
15k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
770
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
580
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k