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への愛2018
Search
hirothings
December 08, 2018
Programming
3.4k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Swiftへの愛2018
Swiftの魅力
最近のSwift
これからのSwift
について発表した資料になります
hirothings
December 08, 2018
More Decks by hirothings
See All by hirothings
minto 10万ダウンロードまでにやったこと・やらなかったこと / minto 100k DL
hirothings
5
2k
VIPER with アーキテクチャ選定 実践入門 / VIPER Architecture
hirothings
4
1.1k
実践Dark Mode対応 / Implementing Dark Mode
hirothings
4
230
iOS標準UIワークショップ / iOS Default UI Workshop
hirothings
3
11k
Modernizing Your UI for iOS 13
hirothings
1
1.3k
WWDC2019 pre party LT
hirothings
0
2.5k
iOSなアーキテクチャVIPERのススメ
hirothings
5
3.6k
Swift2年生
hirothings
4
36k
Swiftへの愛
hirothings
0
36k
Other Decks in Programming
See All in Programming
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
250
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
1.5k
APNsからLive Activityを開始する話
yumnumm
0
180
最近”作らせてる” ローカルAIアプリの話
akit37
0
500
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
1.9k
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.4k
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
4
1.3k
オーケストレーション記述言語 Katari
yukikurage
0
200
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
150
Kotlinの15年とServer-Side Kotlin
n_takehata
1
170
続・コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions-again
handlename
0
130
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
4.7k
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Building an army of robots
kneath
307
47k
Building Applications with DynamoDB
mza
96
7.3k
sira's awesome portfolio website redesign presentation
elsirapls
0
470
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.8k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
290
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Ethics towards AI in product and experience design
skipperchong
2
440
Building the Perfect Custom Keyboard
takai
2
920
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
230
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
560
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