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への愛2018
Search
hirothings
December 08, 2018
Programming
1
2.8k
Swiftへの愛2018
Swiftの魅力
最近のSwift
これからのSwift
について発表した資料になります
hirothings
December 08, 2018
Tweet
Share
More Decks by hirothings
See All by hirothings
VIPER with アーキテクチャ選定 実践入門 / VIPER Architecture
hirothings
4
890
実践Dark Mode対応 / Implementing Dark Mode
hirothings
4
160
iOS標準UIワークショップ / iOS Default UI Workshop
hirothings
3
10k
Modernizing Your UI for iOS 13
hirothings
1
990
WWDC2019 pre party LT
hirothings
0
2.2k
iOSなアーキテクチャVIPERのススメ
hirothings
5
3.1k
Swift2年生
hirothings
4
33k
Swiftへの愛
hirothings
0
34k
Other Decks in Programming
See All in Programming
GraphQLの魅力を引き出すAndroidクライアント実装
morux2
3
650
o1モデルのプロンプトエンジニアリングって?
ktc_wada
0
240
GraphQL あるいは React における自律的なデータ取得について
quramy
11
3k
Amebaチョイス立ち上げの裏側 ~依存システムとの闘い~
daichi_igarashi
0
230
A New Era of Testing
mannodermaus
2
500
『ドメイン駆動設計をはじめよう』中核の業務領域
masuda220
PRO
5
990
Go Code Generation at newmo / 2024-08-27 #newmo_layerx_go
genkey6
0
560
メモリ最適化を究める!iOSアプリ開発における5つの重要なポイント
yhirakawa333
0
410
Why Prism?
kddnewton
4
1.7k
Jakarta EE meets AI
ivargrimstad
0
380
Rechartsで楽にゴリゴリにカスタマイズする!
10tera
1
170
watsonx.ai Dojo #2 生成AIを使ったアプリ開発入門編
oniak3ibm
PRO
0
160
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
230
130k
Fashionably flexible responsive web design (full day workshop)
malarkey
401
65k
Code Review Best Practice
trishagee
62
16k
Gamification - CAS2011
davidbonilla
79
5k
Fantastic passwords and where to find them - at NoRuKo
philnash
48
2.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.4k
For a Future-Friendly Web
brad_frost
174
9.3k
Designing on Purpose - Digital PM Summit 2013
jponch
114
6.8k
Build your cross-platform service in a week with App Engine
jlugia
228
18k
Music & Morning Musume
bryan
46
6k
Large-scale JavaScript Application Architecture
addyosmani
508
110k
Transcript
Love Swift 2018 @hirothings
10Ͱ͢͜ͱ • Swiftͱʁ • Swiftͷັྗ • ࠷ۙͷSwift • ͜Ε͔ΒͷSwift •
Hello Swift!
ࣗݾհ • @hirothings (Objective-ͻΖC) • ݩϥʔϝϯళ • ৭ʑ͋ͬͯݱࡏiOSσϕϩούʔ
Swiftͱͷग़ձ͍ • ΤϯδχΞͱͯ͠ΩϟϦΞΛελʔτͨ͠2015 ౙ..ɻ • ͦΕ·ͰJS, PHPΛগʑ͚ͩͬͨͲઓྗʹͳΒͣɺ Ҋ݅ͷSwiftࢼͯ͠ΈΔ୲ʹͳΓSwiftͱग़ձ͏͜ ͱʹ
Swiftͱ • Apple͕2014ʹൃදͨ͠ϓϩάϥϛϯάݴޠ • ͷͪΦʔϓϯιʔεԽ https://github.com/apple/swift • ࣮ߦ͕͍, Ϟμϯ, ҆શ
• ΞΠίϯΞϚπόϝ https://www.apple.com/jp/swift/ ΑΓ
Swiftͷັྗ • ݫ֨ͳܕγεςϜ • Ϟμϯͳจ๏ • null҆શͳݴޠ • ܕத৺ͷݴޠ •
GenericsΛ༻͍ͨॊೈ͞
ݫ֨ͳܕγεςϜ • ੩తܕ͚ݴޠ • ίϯύΠϥ͕ίʔυͷ҆શੑΛ୲อͯ͘͠ΕΔ • ҉తͳίʔυ͕গͳ͘ͳΔ • ܕʹରͯ͠ݫࣗ͘͠વͱλΠϓηʔϑͳॻ͖ํ Λʹ͚ͭΒΕΔ
Ϟμϯͳจ๏ • ܕਪ • Ϋϩʔδϟ • ߴ֊ؔ (map, flatMap, filter,
reduce..) • ϓϩτίϧ / ϓϩτίϧ֦ு • δΣωϦΫε • λϓϧ / ෳͷΓ • ϝϞϦͷࣗಈཧ(ARC)
null҆શͳݴޠ null҆શͱ: null͕ݪҼͰ࣮ߦ࣌ΤϥʔʹͳΒͳ͍Έ OVMM҆શͰͳ͍ݴޠɺϨΨγʔݴޠͩIUUQTRJJUBDPNLPIFSJUFNT FCECBCΑΓ
null҆શͳݴޠ • nullνΣοΫΛίϯύΠϧ࣌ʹνΣοΫͰ͖Δ • मਖ਼͠ͳ͍ͱͦͦϏϧυ͕௨Βͳ͍
ܕத৺ͷݴޠ ࢀরܕͷ • ίʔυΛΘͳ͍ͱɺͲ͜·ͰΠϯελϯε͕ ڞ༗͞Ε͍ͯΔͷ͔ෆ໌ +BWBTDSJQUͷ"SSBZ ࢀরܕ ͷྫ
ඪ४ϥΠϒϥϦͷ΄ͱΜͲ͕ ܕ • String • Array • Dictionary • Bool
• Int • Double • Float
ίϐʔ͝ͱʹίετ͕͔͔Δ ͷͰʁ
Copy on Write • ೖ࣌Ͱίϐʔ͕ൃੜ͠ͳ͍ • Λมߋ࣌ɺॳΊͯΠϯελϯε͕࡞ΒΕΔ Έ • ͜ͷΈͷ͓͔͛ͰArrayͳͲͰܕΛ࣮ݱ
GenericsΛ༻͍ͨॊೈ͞ • 2ͭͷҾΛswap͢Δؔ • IntܕͷҾͷΈαϙʔτ • ৼΔ͍ಉ͕ͩ͡ɺ͋ΒΏΔܕΛαϙʔτͨ͠ ͍..
• GenericsͰղܾ • ܕύϥϝʔλ <T> • ؔ, δΣωϦοΫܕ(Class, Struct)ɺ͋ΒΏΔ ໘Ͱ͑Δ
IUUQTEPDTTXJGUPSHTXJGUCPPL-BOHVBHF(VJEF(FOFSJDTIUNM
࠷ۙͷSwift • όʔδϣϯΞοϓ͕ΊΜͲ͏ʁ • Φʔϓϯιʔεͱͯ͠ͷػೳڧԽ
• Swift2 to 3ͷΑ͏ͳࠈͳ͍ • Swift3ͰObj-CʹҾͬுΒΕ༷ͨΛόοαϦͬͯ҆ఆ͖ͯͨ͠ • Swift4.1 to 4.2ͷMigration࣌ؒͰऴΘͬͨɻ
• XcodeͷMigrationػೳ + ͪΐͬͱͨ͠मਖ਼ͰDone • Ξοϓσʔτͷ͍ϥΠϒϥϦSwift3ͰίϯύΠϧ όʔδϣϯΞοϓ͕ΊΜͲ͏ʁ
• จࣈྻͷڧԽ • StringͷCollection TypeԽ • ෳߦจࣈྻϦςϥϧͷαϙʔτ • Randomؔͷ࣮ •
ࠓ·ͰCͷؔarc4random_uniform Λ͍͕ͬͯͨɺLinuxڥͰ αϙʔτ͞Εͯͳ͍ͨΊ໘ͩͬͨ • Dynamic Member Lookup Φʔϓϯιʔεͱͯ͠ͷػೳڧԽ
͜Ε͔ΒͷSwift • ABI҆ఆԽ • async / await
ABI҆ఆԽ • (ͣͬͱ༏ઌ՝͚ͩͲ)Swift5ͷϦϦʔεཁ݅ • ෳͷSwiftόʔδϣϯͷڞଘ • ҠߦͷπϥϛݮΔ • ϥΠϒϥϦ੍࡞ऀخ͍͠ •
ݱࡏϞδϡʔϧ୯ҐͰSwift3 or 4Λࢦఆͯࠞ͠ࡏͤ͞ Δ͜ͱՄೳ
async / await • ඇಉظॲཧΛಉظॲཧతʹॻ͚Δ • ࠓ·ͰRxSwiftͳͲؔܕϓϩάϥϛϯάͷΞϓϩʔν ΛಋೖͤͶͳΒͣ؆୯Ͱͳ͔ͬͨ • ࣮࣌ظ·ͩະ֬ఆ
• KotlinͰ͢ͰʹίϧʔνϯಋೖࡁΈ • SwiftͷੜΈͷΫϦεϥτφʔ͕proposalग़ͨ͠
Before async / await
After (Proposalͷྫ) async / await
Hello! Swift
Swift Playgrounds • iPadͰήʔϜײ֮ͰSwiftΛ৮ΕΔެࣜΞϓϦ IUUQTXXXBQQMFDPNKQTXJGUQMBZHSPVOET
Playground • ϦΞϧλΠϜͰ࣮ߦ͞ΕΔΤσΟλ • ཁXcode
Server Side Swift • UIKitʹڵຯͳ͍ํʹΦεεϝ • Ϗϧυ͍͠ɺ؆୯ͳAPIͳΒϗεςΟϯά·Ͱ Ͱ͖ΔϑϨʔϜϫʔΫ(ݸਓΞϓϦͷAPISSSͰ࣮ͯ͠·͢)
One more things..
࠷ۙͷXcodeʹ͍ͭͯ
ෳγϛϡϨʔλΛͬͨฒྻςετ
Diffʹ৭͕ͭ͘Α͏ʹͳͬͨ!!
Xcode10Ͱ͍ͭʹϚϧνΧʔιϧରԠ!!
Fin