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
3年間作り続けて来たアプリをSwift化した話
Search
sun54907
March 01, 2017
Technology
0
6.6k
3年間作り続けて来たアプリをSwift化した話
これで2番目に話したやつです
https://cyberagent.connpass.com/event/49553/
sun54907
March 01, 2017
Tweet
Share
More Decks by sun54907
See All by sun54907
CreateMLを使ってサクラを判定しよう | iOSDC 2018 LT
sun54907
1
930
既存のプロジェクトに、Firestoreを導入してみた
sun54907
1
1.1k
stackViewを使ってボタンをつくった話
sun54907
0
950
Introducing Password AutoFill
sun54907
1
530
Other Decks in Technology
See All in Technology
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
310
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
1
120
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
120
『Firebase Dynamic Links終了に備える』 FlutterアプリでのAdjust導入とDeeplink最適化
techiro
0
160
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
110
Lexical Analysis
shigashiyama
1
150
TypeScript、上達の瞬間
sadnessojisan
46
13k
Engineer Career Talk
lycorp_recruit_jp
0
190
SRE×AIOpsを始めよう!GuardDutyによるお手軽脅威検出
amixedcolor
0
200
DynamoDB でスロットリングが発生したとき_大盛りver/when_throttling_occurs_in_dynamodb_long
emiki
1
440
The Rise of LLMOps
asei
9
1.7k
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Making Projects Easy
brettharned
115
5.9k
Writing Fast Ruby
sferik
627
61k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Unsuck your backbone
ammeep
668
57k
Happy Clients
brianwarren
98
6.7k
Transcript
3ؒ࡞Γଓ͚͖ͯͨ ΞϓϦΛSwiftԽͨ͠
ࣗݾհ ւ 28ࡀ (ג)ϚονϯάΤʔδΣϯτ iOSྺ 5 ͖: ͳΊ͜ ࠷ۙͷϚΠϒʔϜɿFGOɺFE
ώʔϩʔζ
ฐࣾΞϓϦհ
λοϓϧੜ ϚονϯάαʔϏε 201312݄͔Β։ൃɻ ཌ5݄ɺϦϦʔε 2017ݱࡏɺDAU11ສ (͏ͪiOS6ສ)
λοϓϧੜ iOS൛ SwiftԽϓϩδΣΫτ
࣍ ίʔυͷ༁ Obj-C → Swift 2.3 Swift 2.3 → Swift
3.0
ίʔυͷ༁
ίʔυͷ༁ SwiftԽ͢Δલ Objective-C 99.5% ݱࡏ Objective-C 81.2% Swift 18.6%
ίʔυͷྔ Swift͢Δલ .m, .hϑΝΠϧ߹Θͤͯ600ϑΝΠϧఔ ܭ60,000ߦ
Objective-C → Swift 2.3
͖͔͚ͬ ͍ϓϩδΣΫτͳͷͰɺٕज़తෛ࠴͕ଟ͍ ࢪࡦʹΘΕ͍ͯΔঢ়گ Ұճ͔ͬ͠Γͱվળ͚ͩΛ͍ͨ͠ 201611݄ɺվળͷͨΊɺ։ൃ߹॓Λ͢Δ͜ͱʹ ͳͬͨ
։ൃ߹॓ͷৄ͍ͪ͜͠Β https://developers.cyberagent.co.jp/blog/ archives/2055/
SwiftԽϩʔυϚοϓ 1ധ2ͷ։ൃ߹॓ͰҰؾʹΓ͖Δ ඪSwiftԽ100%! iOSΤϯδχΞ2ਓɺ࡞ۀ࣌ؒ16࣌ؒ΄Ͳɻܭ32 ࣌ؒ ίϯόʔλʔΛͬͯҰؾʹม ͱΓ͋͑ͣಈ͘Α͏ʹͯ͠ɺޙͰϦϑΝΫλϦϯά
ίϯόʔλͷछྨ Swiftify iSwift objc2swift
Swiftify ֹ݄14.99$ ແྉͩͱ10KB·ͰͷίʔυΛมͰ͖Δ ༗ྉͳΒϑΝΠϧ͝ͱɺϓϩδΣΫτ͝ͱมՄೳ Swift2.2, 3.0 ʹมՄೳ
iSwift ༗ྉ(14.99$) Σϒ্ͰมՄೳ MacΞϓϦ͕͋Γɺ1͚ͩແྉମݧͰ͖Δ Swift2.2, 3.0ʹมՄೳ
objc2swift ແྉ ίϚϯυϥΠϯ͔ΒมͰ͖Δ hϑΝΠϧɺmϑΝΠϧΛҰॹʹม͢Δ Swift2.xʹมͰ͖Δ Yahooͷਓ͕࡞ͬͨ
બΕͨͷ…
objc2swiftΛ࠾༻ ແྉʂ ίϚϯυϥΠϯ͍͍ͬͯ yahoo࡞ͱ͍͏৴པײ http://qiita.com/shu223/items/ 7a20d97d93e056a4e0ac
Start!
ૣน͕…
None
* ※࣌ͷͷͰͳ͘ɺswift3ରԠޙʹͬͨͷͳͷͰɺ AnyHashableͱ͔ͬͯ·͢
☠ܯࠂࡇΓ☠ ม͚ͩͰऴΘΔ͜ͱ100%ͳ͍ XcodeͷαδΣετ͕ग़Δܯࠂ͕͘Β͍ ΓࣗྗͰͲ͏ʹ͔͢Δ͔͠ͳ͍ ͍͍ͩͨ100ߦ͘Β͍Ͱ40ݸ΄Ͳܯࠂ͕ग़Δ
* ※࣌ͷͷͰͳ͘ɺswift3ରԠޙʹͬͨͷ ͜ΕΛ
͜ͷঢ়ଶ·Ͱ15 ~ 30͘Β͍͔͔Δ !ͱ͔ͬͯΔͷͰ·ͩमਖ਼͕ඞཁͩ͠ɺϩδοΫ͕ਖ਼͍͠ ͔ݕূ͕ඞཁ * ※࣌ͷͷͰͳ͘ɺswift3ରԠޙʹͬͨͷ
։ൃ߹॓ͷՌ .m : 317ϑΝΠϧ 50381ߦ → 269ϑΝΠϧ 44688ߦ .h :
324ϑΝΠϧ 10124ߦ → 262ϑΝΠϧ 7818ߦ swift : 3ϑΝΠϧ 199ߦ → 63ϑΝΠϧ 4297ߦ 7999ߦআɺ4098ߦՃ
શମͷ…
શମͷ…8%!
None
ল ؆୯ʹ͍͔ͳ͍ͷΘ͔͚ͬͯͨͲɺ͔ͳΓͩ ͱΘ͔ͬͨ ඪͪΌΜͱཱͯΑ͏
߹॓ͷΑ͔ͬͨϙΠϯτ SwiftԽͷ͖͔͚ͬʹͳͬͨ શମΛίϯόʔτ͢Δͷʹ͔͔Δ͕࣌ؒͬ͘͟Γ༧ ଌͰ͖ΔΑ͏ʹͳͬͨ جຊσʔλΛѻ͏ΫϥεΛશ෦มͰ͖ͨ
Objective-CͷΫϥεΛ Swift͔ΒݺͿͱ !ࡇΓͰ͍ * ※࣌ͷͷͰͳ͘ɺswift3ରԠޙʹͬͨͷ
࣮ߦ࣌ΤϥʔͷԹচͱͳΓ͔Ͷͳ͍ ݺͼग़͢ଆͰͳ͘ɺݺͼग़͞ΕΔଆ͔ΒSwiftԽ͠ ·͠ΐ͏ ͘͠Objective-Cଆʹɺnullable, nonnullΛ͚ͭΔ
Swift 2.3 → Swift 3.0
͖͔͚ͬ Xcode 8.3 ͔Β Swift 2.3 ରԠ͠ͳ͍ ! ͍!!
ͦͦͳͥ2.3ͩͬͨͷ? ͬͨίϯόʔλ͕ Swift2.3͔͠ରԠͯ͠ͳ͔ͬͨ ແྉͱ͍͏᠘ʹҾ͔͔ͬͬͨ
͏ίϯόʔλʔͪ͜Β
͏ม͜Γ͝Γ͓ͩ…>< ·ͨਏ͍࡞ۀ͕࢝·Δ…
͓…Swiftͷ༷ࢠ͕…
ҙ֎ͱ͏·͍ͬͨ͘Swift3Խ AppleఏڙίϯόʔλʔͰ͖Δ͜ ͍͍ͩͨͷΤϥʔ͕ΫϦοΫͰ࣏Δͭ 10࣌ؒఔͰ ͨ·ʹҾֻ͚ͬ͋Δ͔Βҙ
Ҿֻ͚ͬϙΠϯτ উखʹ!?͕ͭ͘ͷͰҙ
ࠓޙͷϩʔυϚοϓ ݱࡏ Swift 20% དྷظͰ80%Λࢦ͢ ຖ݄ͷϚΠϧετʔϯΛઃఆ
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠
SwiftԽ͢Δཧ༝
͑ʁͨΓલͩΑͶ…? Swiftࠓ࠷ͳݴޠɻObjective-Cݹ͍ Ϟμϯͳॻ͖ํ͕Ͱ͖Δɻܕਪɺstructɺ OptionalValueͳͲͳͲศརͳػೳ͕ଟ͍ ΤϯδχΞͱͯ͠ͷΛߟ͑ΔͱɺSwiftΛͬͨ ํ͕໌Β͔ʹ͍͍
ձࣾೲಘͯ͘͠Εͳ͍ SwiftԽʹԿϲ݄͔͔Δͷʁ ࠓͷίʔυͰԿ͔͕͋Δͷ͔ʁ SwiftԽͰ՝্͕ۚΔͷ͔ʁ Objective-Cͷํ͕ॻ͖׳ΕͯΔͰ͠ΐʁ
ࣄҊ: ࠾༻ࣦഊ ͍͍ײ͡ͷͰ͖ΔΤϯδχΞM܅͕དྷࣾ ͏ͪͷίʔυͷ༁Λઆ໌(swift20%) ʮObj-Cॻ͖ͨ͘ͳ͍ΜͰ͢ΑͶʯ ࠾༻Ͱ͖ͣ