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
iOSレガシーコード改善ガイド〜マンガボックス開発における事例〜
Search
kenmaz
January 29, 2016
Programming
1
400
iOSレガシーコード改善ガイド〜マンガボックス開発における事例〜
2016/01/29に開催された「DeNA TechCon 2016」での講演資料です。
https://techcon.dena.com
kenmaz
January 29, 2016
Tweet
Share
More Decks by kenmaz
See All by kenmaz
iOSアプリ開発者がテスラを買って色々調べたりアプリを作ったりしつつまだ見ぬApple Carを想像する
kenmaz
2
4.1k
Xcode PreviewsからSnapshotテストを自動生成する
kenmaz
1
500
Xcode Previews でUIKitベースのアプリ開発を効率化する - iOSDC Japan 2020
kenmaz
12
13k
モバイル決済アプリの作り方 / How to develop a mobile payment app
kenmaz
6
7.8k
Developing Apple Pay In-App Provisioning in merpay
kenmaz
6
2k
Developing Apple Pay In-App Provisioning
kenmaz
6
2.1k
Super Resolution with CoreML (Long Version)
kenmaz
3
34k
Super Resolution with CoreML @ try! Swift Tokyo 2018
kenmaz
5
40k
CoreMLでアイドル顔認識アプリを作ろう
kenmaz
6
13k
Other Decks in Programming
See All in Programming
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
120
推し活としてのrails new/oshikatsu_ha_iizo
sakahukamaki
3
1.6k
Sidekiqで実現する 長時間非同期処理の中断と再開 / Pausing and Resuming Long-Running Asynchronous Jobs with Sidekiq
hypermkt
6
2.6k
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
240
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
11
2.3k
リリース8年目のサービスの1800個のERBファイルをViewComponentに移行した方法とその結果
katty0324
5
3.5k
役立つログに取り組もう
irof
26
8.5k
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
7
420
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
230
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
420
GCCのプラグインを作る / I Made a GCC Plugin
shouth
1
150
Vue3の一歩踏み込んだパフォーマンスチューニング2024
hal_spidernight
3
3.1k
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
404
65k
Scaling GitHub
holman
458
140k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Done Done
chrislema
181
16k
GraphQLの誤解/rethinking-graphql
sonatard
66
9.9k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
YesSQL, Process and Tooling at Scale
rocio
167
14k
Designing Experiences People Love
moore
138
23k
Fireside Chat
paigeccino
32
3k
Thoughts on Productivity
jonyablonski
67
4.3k
GraphQLとの向き合い方2022年版
quramy
43
13k
Transcript
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. J04ϨΨγʔίʔυվળΨΠυ 1 Jan
29, 2016 দલ݈ଠ IPϓϥοτϑΥʔϜࣄۀ෦ୈ̍෦ DeNA Co., Ltd. ʙϚϯΨϘοΫε։ൃʹ͓͚Δࣄྫʙ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ࣗݾհ দલ݈ଠ (id:kenmaz)
2003.4 ཱιϦϡʔγϣϯζ (چɾཱιϑτΣΞΤϯδχΞϦϯάʣ SIer, Java, Ruby, ଞ 2009.6 υϫϯΰ χίχίɺଞ 2013.4 DeNA ϚϯΨϘοΫε ϦʔυΤϯδχΞ 2
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 3
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 4 ϓϩ࡞Ոͷ
ඳ͖͓Ζ͠࡞͕ ຖߋ৽ɺແྉͰಡΊΔ ϚϯΨࡶࢽΞϓϦ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 5
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 6 ిࢠॻ੶ετΞ ϚϯΨߘ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ຊ 7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ϨΨγʔίʔυʹ͍ͭͯ 8
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ϚϯΨϘοΫεʹ͓͚ΔϨΨγʔίʔυ •։ൃελʔτ͔Β̏ •iOS6࣌ͷίʔυଟ
•ػೳՃʹ͏ίʔυͷෳࡶԽ •ϨΨγʔίʔυԽͷஹީ 9
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ϚϯΨϘοΫεʹ͓͚ΔϨΨγʔίʔυ •։ൃελʔτ͔Β̏ •iOS6࣌ͷίʔυଟ
•ػೳՃʹ͏ίʔυͷෳࡶԽ •ϨΨγʔίʔυԽͷஹީ 9 iOSϨΨγʔίʔυվળΨΠυ ϨΨγʔίʔυԽͤ͞ͳ͍ͨΊͷऔΓΈ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶃϦϦʔεαΠΫϧͷݟ͠ ᶄSwiftͷҠߦ ᶅAutoLayoutͷରԠ
ᶆઃܭ ᶇӡ༻ɾϩά 10 iOS ϨΨγʔίʔυվળΨΠυ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶃϦϦʔεαΠΫϧͷݟ͠ ᶄSwiftͷҠߦ ᶅAutoLayoutͷରԠ
ᶆઃܭ ᶇӡ༻ɾϩά 10 iOS ϨΨγʔίʔυվળΨΠυ ޙwebͰެ։Ͱ͖Εɾɾɾ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. SwiftͷҠߦ 11 iOSϨΨγʔίʔυվળΨΠυ
ͦͷᶄ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 12 h)ps://developer.apple.com/swi7/ SwiftҠߦͷҙٛ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 12 h)ps://developer.apple.com/swi7/ SwiftҠߦͷҙٛ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 12 h)ps://developer.apple.com/swi7/ •
Type Safe • Op<onal • Immutable • Generics SwiftҠߦͷҙٛ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 12 h)ps://developer.apple.com/swi7/ •
Type Safe • Op<onal • Immutable • Generics SwiftҠߦͷҙٛ ݴޠͷ҆શੑʹΞϓϦͷ࣭ʹ݁
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. iOSΤϯδχΞ 1.5ਓ Ͳ͏͢Δ
13
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. SwiftҠߦͷجຊઓུ 14
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. SwiftҠߦͷجຊઓུ 1. طଘίʔυͷڍಈΛഁյ͠ͳ͍͜ͱ
14
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. SwiftҠߦͷجຊઓུ 1. طଘίʔυͷڍಈΛഁյ͠ͳ͍͜ͱ
2. طଘobjcίʔυͷमਖ਼ۃྗSwiftͰߦ͏͜ͱ 14
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. SwiftҠߦͷجຊઓུ 1. طଘίʔυͷڍಈΛഁյ͠ͳ͍͜ͱ
2. طଘobjcίʔυͷमਖ਼ۃྗSwiftͰߦ͏͜ͱ 3. ஈ֊తʹঃʑʹҠߦ͢͢ΊΔ͜ͱ 14
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. SwiftҠߦͷجຊઓུ 1. طଘίʔυͷڍಈΛഁյ͠ͳ͍͜ͱ
2. طଘobjcίʔυͷमਖ਼ۃྗSwiftͰߦ͏͜ͱ 3. ஈ֊తʹঃʑʹҠߦ͢͢ΊΔ͜ͱ 4. SwiftΒ͍͠ίʔυΛॻ͍࣮ͯ֬ʹ࣭ΛߴΊΔ͜ͱ 14
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. SwiftҠߦͷجຊઓུ 1. طଘίʔυͷڍಈΛഁյ͠ͳ͍͜ͱ
2. طଘobjcίʔυͷमਖ਼ۃྗSwiftͰߦ͏͜ͱ 3. ஈ֊తʹঃʑʹҠߦ͢͢ΊΔ͜ͱ 4. SwiftΒ͍͠ίʔυΛॻ͍࣮ͯ֬ʹ࣭ΛߴΊΔ͜ͱ 5. ہॴతͳଥڠڐ༰ 14
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. SwiftҠߦͷجຊઓུ 1. طଘίʔυͷڍಈΛഁյ͠ͳ͍͜ͱ
2. طଘobjcίʔυͷमਖ਼ۃྗSwiftͰߦ͏͜ͱ 3. ஈ֊తʹঃʑʹҠߦ͢͢ΊΔ͜ͱ 4. SwiftΒ͍͠ίʔυΛॻ͍࣮ͯ֬ʹ࣭ΛߴΊΔ͜ͱ 5. ہॴతͳଥڠڐ༰ 14 →Mix-and-Match
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Mix and Match
ͻͱͭͷϓϩδΣΫτͰObjective-CͱSwiftΛࠞ߹ͯ͠͏ͨΊͷػೳ 15 h)ps://developer.apple.com/library/ios/documenta<on/Swi7/Conceptual/BuildingCocoaApps/MixandMatch.html
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Mix and MatchΛͬͨSwiftҠߦύλʔϯ
16
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Mix and MatchΛͬͨSwiftҠߦύλʔϯ
16 ᶃ Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Mix and MatchΛͬͨSwiftҠߦύλʔϯ
16 ᶃ Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ ύλʔϯ ≒ ಓʹ͓͚Δܗ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Mix and MatchΛͬͨSwiftҠߦύλʔϯ
16 ᶃ Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ ύλʔϯ ≒ ಓʹ͓͚Δܗ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Mix and MatchΛͬͨSwiftҠߦύλʔϯ
16 ᶃ Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ ύλʔϯ ≒ ಓʹ͓͚Δܗ ύλʔϯԽ͢Δҙٛ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Mix and MatchΛͬͨSwiftҠߦύλʔϯ
16 ᶃ Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ ύλʔϯ ≒ ಓʹ͓͚Δܗ ύλʔϯԽ͢Δҙٛ → ໎ΘͣஅͰ͖Δ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Mix and MatchΛͬͨSwiftҠߦύλʔϯ
16 ᶃ Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ ύλʔϯ ≒ ಓʹ͓͚Δܗ ύλʔϯԽ͢Δҙٛ → ໎ΘͣஅͰ͖Δ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Mix and MatchΛͬͨSwiftҠߦύλʔϯ
16 ᶃ Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ ύλʔϯ ≒ ಓʹ͓͚Δܗ ύλʔϯԽ͢Δҙٛ → ໎ΘͣஅͰ͖Δ ※֤ύλʔϯ໊ࢲʹΑΔউखͳ໋໊
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶃԆ໋ύλʔϯ 17 Objec<ve-‐C
swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶃԆ໋ύλʔϯ 17 objc
class objc class objc class Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶃԆ໋ύλʔϯ 17 objc
class objc class objc class Nullability, Genericsʹؔ͢ΔΞϊςʔγϣϯΛՃ Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶃԆ໋ύλʔϯ 17 objc
class objc class objc class Nullability, Genericsʹؔ͢ΔΞϊςʔγϣϯΛՃ ܕ҆શɾnil ҆શ ͳੈք Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶃԆ໋ύλʔϯ 17 objc
class objc class objc class Nullability, Genericsʹؔ͢ΔΞϊςʔγϣϯΛՃ ܕ҆શɾnil ҆શ ͳੈք swi7 ҆શʹΞΫηε Objec<ve-‐C swi7
ᶃԆ໋ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. objcʹ Nullability,
Lightweight GenericsΛՃ͢Δ 18 @interface UserHistory -(Episode*)lastEepisode; -(NSArray*)allEpisodes; @end
ᶃԆ໋ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. objcʹ Nullability,
Lightweight GenericsΛՃ͢Δ 18 @interface UserHistory -(Episode*)lastEepisode; -(NSArray*)allEpisodes; @end NS_ASSUME_NONNULL_BEGIN @interface UserHistory -(nullable Episode*)lastEepisode; -(NSArray<Episode*>*)allEpisodes; NS_ASSUME_NONNULL_END @end
ᶃԆ໋ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. objcʹ Nullability,
Lightweight GenericsΛՃ͢Δ 18 @interface UserHistory -(Episode*)lastEepisode; -(NSArray*)allEpisodes; @end NS_ASSUME_NONNULL_BEGIN @interface UserHistory -(nullable Episode*)lastEepisode; -(NSArray<Episode*>*)allEpisodes; NS_ASSUME_NONNULL_END @end class UserHistory { func lastEepisode()->Episode? func allEepisodes()->[Episode] }
ᶃԆ໋ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. objcʹ Nullability,
Lightweight GenericsΛՃ͢Δ • طଘͷobjcࢿ࢈Λ҆શʹ͑Δ • ϩʔίετɾϋΠϦλʔϯ • SwiftରԠͷୈҰาͱͯ͠࠷ద 18 @interface UserHistory -(Episode*)lastEepisode; -(NSArray*)allEpisodes; @end NS_ASSUME_NONNULL_BEGIN @interface UserHistory -(nullable Episode*)lastEepisode; -(NSArray<Episode*>*)allEpisodes; NS_ASSUME_NONNULL_END @end class UserHistory { func lastEepisode()->Episode? func allEepisodes()->[Episode] }
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶄ͝৽نύλʔϯ 19 Objec<ve-‐C
swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶄ͝৽نύλʔϯ 19 objc
class objc class objc class Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶄ͝৽نύλʔϯ 19 objc
class objc class objc class ViewController .swi7 View Model Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶄ͝৽نύλʔϯ 19 objc
class objc class objc class instan<ate ViewController .swi7 View Model Objec<ve-‐C swi7
ᶄ͝৽نύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ৽نViewControllerجຊϑϧSwiftͰॻ͘ ʮ৽ن։ൃSwiftͰॻ͖·͢ʯύλʔϯ
طଘͷobjcίʔυͷґଘ͕গͳ͘Γ͍͢ ৽͍͠ը໘ػೳΛՃ͢Δέʔεʹ͓͢͢Ί ྫʣ • ϢʔβొɾϩάΠϯ • ϚΠϝχϡʔ • ίΠϯߪೖॲཧ • ಈըࠂ 20
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 21 ᶅΓग़͠ύλʔϯ Objec<ve-‐C
swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 21 ᶅΓग़͠ύλʔϯ objc
class method Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 21 ᶅΓग़͠ύλʔϯ objc
class method Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 21 Logic
.swi7 ᶅΓग़͠ύλʔϯ objc class method Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 21 Logic
.swi7 ᶅΓग़͠ύλʔϯ objc class method ίʔϧ Objec<ve-‐C swi7
ᶅΓग़͠ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ϩδοΫΛswiftʹΓग़͢ 22
- (NSNumber*)getNum { NSNumber* num = ...; return num; } .m
ᶅΓग़͠ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ϩδοΫΛswiftʹΓग़͢ 22
if (num.integerValue == 0) { NSLog(@"num is zero"); } else { NSLog(@"num is non zero"); } - (NSNumber*)getNum { NSNumber* num = ...; return num; } .m
ᶅΓग़͠ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ϩδοΫΛswiftʹΓग़͢ 22
- (NSNumber*)getNum { NSNumber* num = ...; return num; } .m
ᶅΓग़͠ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ϩδοΫΛswiftʹΓग़͢ 22
- (NSNumber*)getNum { NSNumber* num = ...; return num; } .m [NumLogger debug:num];
ᶅΓग़͠ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ϩδοΫΛswiftʹΓग़͢ 22
- (NSNumber*)getNum { NSNumber* num = ...; return num; } .m + final class NumLogger: NSObject { class func debug(num:NSNumber) { if num.integerValue == 0 { print("num is zero") } else { print("num is non zero") } } } .swi7 [NumLogger debug:num];
ᶅΓग़͠ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ϩδοΫΛswiftʹΓग़͢ 22
- (NSNumber*)getNum { NSNumber* num = ...; return num; } .m + final class NumLogger: NSObject { class func debug(num:NSNumber) { if num.integerValue == 0 { print("num is zero") } else { print("num is non zero") } } } .swi7 [NumLogger debug:num]; • ࠷খݶͷมߋͰطଘobjcϝιουͷϩδοΫΛՃɾमਖ਼Ͱ͖Δ • ͍Ͳ͜Ζɿϩάग़ྗॲཧɺόϦσʔγϣϯɺUtilతͳॲཧ • Ϣχοτςετॻ͖͍͢
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶆϒϦοδύλʔϯ 23 Objec<ve-‐C
swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶆϒϦοδύλʔϯ 23 objc
class objc class objc class Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶆϒϦοδύλʔϯ 23 Nested
Type Top-‐level func<on Typealias Tuple enum enum enum struct struct struct objc class objc class objc class Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶆϒϦοδύλʔϯ 23 Nested
Type Top-‐level func<on Typealias Tuple enum enum enum struct struct struct objc class objc class objc class Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶆϒϦοδύλʔϯ 23 Nested
Type Top-‐level func<on Typealias Tuple enum enum enum struct struct struct objc class objc class objc class Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ᶆϒϦοδύλʔϯ 23 Nested
Type Top-‐level func<on Typealias Tuple enum enum enum struct struct struct objc class objc class objc class Bridging NSObject Objec<ve-‐C swi7
objcͱswiftͷڮ͠ Ұఆنͷswfitίϯϙʔωϯτ objcίʔυ ͷڮ͠ ᶆϒϦοδύλʔϯ Copyright (C) DeNA Co.,Ltd. All
Rights Reserved. 24 ࠂ Ad networking logging imp click display/ event handling
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 25 ᶇextensionύλʔϯ Objec<ve-‐C
swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 25 ᶇextensionύλʔϯ FooClass
method1 method2 Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 25 ᶇextensionύλʔϯ FooClass
method1 method2 method3 Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 25 ᶇextensionύλʔϯ FooClass
method1 method2 method3 FooClass extension Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 25 ᶇextensionύλʔϯ FooClass
method1 method2 method3 FooClass extension method3 Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 25 ᶇextensionύλʔϯ FooClass
method1 method2 method3 FooClass extension method3 Objec<ve-‐C swi7
ᶇextensionύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. طଘobjcΫϥεΛextension͢Δ 26
@implement FooClass - (void)method1 {...} - (void)method2 {...} @end .m
ᶇextensionύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. طଘobjcΫϥεΛextension͢Δ 26
@implement FooClass - (void)method1 {...} - (void)method2 {...} @end .m + extension FooClass { //ϝιουՃ func method3() { … } } .swi7
ᶇextensionύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. طଘobjcΫϥεΛextension͢Δ 26
@implement FooClass - (void)method1 {...} - (void)method2 {...} @end .m + extension FooClass { //ϝιουՃ func method3() { … } } .swi7 • Ұ൪ࣗવͰద༻͍ͤ͢͞ύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 27 ᶇextensionύλʔϯ ViewerController
Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 27 ᶇextensionύλʔϯ ViewerController
Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 27 ᶇextensionύλʔϯ ViewerController
Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 27 ᶇextensionύλʔϯ ViewerController
ViewerController extension Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 27 ᶇextensionύλʔϯ ViewerController
ViewerController extension func shareBu)onDidTapped() Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 27 ᶇextensionύλʔϯ ViewerController
ViewerController extension func shareBu)onDidTapped() Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 28 ᶈ࿐ύλʔϯ Objec<ve-‐C
swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 28 ᶈ࿐ύλʔϯ FooClass
property1 method1 Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 28 ᶈ࿐ύλʔϯ FooClass
property1 method1 Objec<ve-‐C swi7 method2
FooClass extension ᶇ extensionύλʔϯ Copyright (C) DeNA
Co.,Ltd. All Rights Reserved. 28 ᶈ࿐ύλʔϯ FooClass property1 method1 Objec<ve-‐C swi7 method2
FooClass extension ᶇ extensionύλʔϯ Copyright (C) DeNA
Co.,Ltd. All Rights Reserved. 28 ᶈ࿐ύλʔϯ FooClass property1 method1 Objec<ve-‐C swi7 method2 method2
FooClass extension ᶇ extensionύλʔϯ Copyright (C) DeNA
Co.,Ltd. All Rights Reserved. 28 ᶈ࿐ύλʔϯ FooClass property1 method1 ࢀরɾίʔϧෆՄ Objec<ve-‐C swi7 method2 method2
FooClass extension ᶇ extensionύλʔϯ Copyright (C) DeNA
Co.,Ltd. All Rights Reserved. 28 ᶈ࿐ύλʔϯ FooClass property1 method1 Objec<ve-‐C swi7 method2 method2
FooClass extension ᶇ extensionύλʔϯ Copyright (C) DeNA
Co.,Ltd. All Rights Reserved. 28 ᶈ࿐ύλʔϯ FooClass property1 method1 Objec<ve-‐C swi7 method2 method2 ҙਤతͳ ΧϓηϧԽͷഁյʂ
FooClass extension ᶇ extensionύλʔϯ Copyright (C) DeNA
Co.,Ltd. All Rights Reserved. 28 ᶈ࿐ύλʔϯ FooClass property1 method1 Bridging-‐ Header.h Objec<ve-‐C swi7 method2 method2 ҙਤతͳ ΧϓηϧԽͷഁյʂ
FooClass extension ᶇ extensionύλʔϯ Copyright (C) DeNA
Co.,Ltd. All Rights Reserved. 28 ᶈ࿐ύλʔϯ FooClass property1 method1 Bridging-‐ Header.h Objec<ve-‐C swi7 property1 method1 ެ։ method2 method2 ҙਤతͳ ΧϓηϧԽͷഁյʂ
FooClass extension ᶇ extensionύλʔϯ Copyright (C) DeNA
Co.,Ltd. All Rights Reserved. 28 ᶈ࿐ύλʔϯ FooClass property1 method1 Bridging-‐ Header.h ࢀরɾίʔϧ Objec<ve-‐C swi7 property1 method1 ެ։ method2 method2 ҙਤతͳ ΧϓηϧԽͷഁյʂ
ᶈ࿐ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 29 @interface
FooClass () @property NSString property1; @end @implement FooClass (void)method1 { ... } @end .m @interface FooClass @end .h
ᶈ࿐ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 29 @interface
FooClass () @property NSString property1; @end @implement FooClass (void)method1 { ... } @end .m #import “xxx.h” #import “yyy.h” #import “zzz.h” ... @interface FooClass (PrivateForSwift) @property (readonly) NSString *property1; (void)method1; @end Xxxx-‐Bridging-‐Header.h + @interface FooClass @end .h
ᶈ࿐ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 29 @interface
FooClass () @property NSString property1; @end @implement FooClass (void)method1 { ... } @end .m extension FooClass { func methods() { property1 = “foo"; method1() } } .swi7 + #import “xxx.h” #import “yyy.h” #import “zzz.h” ... @interface FooClass (PrivateForSwift) @property (readonly) NSString *property1; (void)method1; @end Xxxx-‐Bridging-‐Header.h + @interface FooClass @end .h
ᶈ࿐ύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 29 @interface
FooClass () @property NSString property1; @end @implement FooClass (void)method1 { ... } @end .m extension FooClass { func methods() { property1 = “foo"; method1() } } .swi7 + #import “xxx.h” #import “yyy.h” #import “zzz.h” ... @interface FooClass (PrivateForSwift) @property (readonly) NSString *property1; (void)method1; @end Xxxx-‐Bridging-‐Header.h + @interface FooClass @end .h ↑objcҰมߋ͍ͯ͠ͳ͍
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 30 ϓϥΠϕʔτଐੑΛ෦తʹެ։͢Δ ᶈ࿐ύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ҙਤతʹΧϓηϧԽΛഁյ 30 ϓϥΠϕʔτଐੑΛ෦తʹެ։͢Δ
ᶈ࿐ύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ҙਤతʹΧϓηϧԽΛഁյ ⁃ extension͔ΒຊମΫϥεͷϓϥΠϕʔτଐੑͷΞΫηε͕
Մೳʹ 30 ϓϥΠϕʔτଐੑΛ෦తʹެ։͢Δ ᶈ࿐ύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ҙਤతʹΧϓηϧԽΛഁյ ⁃ extension͔ΒຊମΫϥεͷϓϥΠϕʔτଐੑͷΞΫηε͕
Մೳʹ ⁃ มߋՕॴϒϦοδϯάϔομͷΈɺطଘͷ.h/.mมߋͳ͠ 30 ϓϥΠϕʔτଐੑΛ෦తʹެ։͢Δ ᶈ࿐ύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ҙਤతʹΧϓηϧԽΛഁյ ⁃ extension͔ΒຊମΫϥεͷϓϥΠϕʔτଐੑͷΞΫηε͕
Մೳʹ ⁃ มߋՕॴϒϦοδϯάϔομͷΈɺطଘͷ.h/.mมߋͳ͠ ଥڠ͕ඞཁͳ෦ 30 ϓϥΠϕʔτଐੑΛ෦తʹެ։͢Δ ᶈ࿐ύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ҙਤతʹΧϓηϧԽΛഁյ ⁃ extension͔ΒຊମΫϥεͷϓϥΠϕʔτଐੑͷΞΫηε͕
Մೳʹ ⁃ มߋՕॴϒϦοδϯάϔομͷΈɺطଘͷ.h/.mมߋͳ͠ ଥڠ͕ඞཁͳ෦ ⁃ ҟͷग़Δͱ͜Ζ 30 ϓϥΠϕʔτଐੑΛ෦తʹެ։͢Δ ᶈ࿐ύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ҙਤతʹΧϓηϧԽΛഁյ ⁃ extension͔ΒຊମΫϥεͷϓϥΠϕʔτଐੑͷΞΫηε͕
Մೳʹ ⁃ มߋՕॴϒϦοδϯάϔομͷΈɺطଘͷ.h/.mมߋͳ͠ ଥڠ͕ඞཁͳ෦ ⁃ ҟͷग़Δͱ͜Ζ ⁃ Ұ࣌తͳରԠɺͱ͍͏ׂΓΓ 30 ϓϥΠϕʔτଐੑΛ෦తʹެ։͢Δ ᶈ࿐ύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ҙਤతʹΧϓηϧԽΛഁյ ⁃ extension͔ΒຊମΫϥεͷϓϥΠϕʔτଐੑͷΞΫηε͕
Մೳʹ ⁃ มߋՕॴϒϦοδϯάϔομͷΈɺطଘͷ.h/.mมߋͳ͠ ଥڠ͕ඞཁͳ෦ ⁃ ҟͷग़Δͱ͜Ζ ⁃ Ұ࣌తͳରԠɺͱ͍͏ׂΓΓ ⁃ ͜͜ΛׂΓΕSwiftԽҰؾʹਐΉ 30 ϓϥΠϕʔτଐੑΛ෦తʹެ։͢Δ ᶈ࿐ύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 31 ᶉͬऔΓύλʔϯ FooClass
method1 property1 31 Objec<ve-‐C swi7 property2 method2
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 31 ᶉͬऔΓύλʔϯ FooClass
method1 property1 31 Objec<ve-‐C swi7 property2 method2 FooClass extension method2 property2 ᶇ extensionύλʔϯ ???
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 31 ᶉͬऔΓύλʔϯ FooClass
method1 property1 31 Objec<ve-‐C swi7 property2 method2 FooClass extension method2 property2 ᶇ extensionύλʔϯ ???
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 32 ᶉͬऔΓύλʔϯ 32
Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 32 ᶉͬऔΓύλʔϯ FooClass
method1 property1 32 Objec<ve-‐C swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 32 ᶉͬऔΓύλʔϯ FooClass
method1 property1 32 Objec<ve-‐C swi7 property2 method2
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 32 ᶉͬऔΓύλʔϯ FooClass
method1 property1 32 Objec<ve-‐C swi7 property2 method2 FooClassBase rename
FooClass Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 32
ᶉͬऔΓύλʔϯ FooClass method1 property1 32 Objec<ve-‐C swi7 property2 method2 FooClassBase rename
FooClass extends Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
32 ᶉͬऔΓύλʔϯ FooClass method1 property1 32 Objec<ve-‐C swi7 property2 method2 FooClassBase rename
FooClass extends Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
32 ᶉͬऔΓύλʔϯ FooClass method1 property1 32 method2 property2 Objec<ve-‐C swi7 property2 method2 FooClassBase rename
FooClass extends Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
32 ᶉͬऔΓύλʔϯ FooClass method1 property1 32 method2 property2 Objec<ve-‐C swi7 FooClassBase rename
FooClass extends Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
32 ᶉͬऔΓύλʔϯ FooClass method1 property1 32 method2 property2 Objec<ve-‐C swi7 ࢀরɾίʔϧ? FooClassBase rename
FooClass extends Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
32 ᶉͬऔΓύλʔϯ FooClass method1 property1 32 method2 property2 Objec<ve-‐C swi7 FooClassBase rename
FooClass extends Bridging-‐ Header.h +ᶈ࿐ύλʔϯ Copyright (C) DeNA
Co.,Ltd. All Rights Reserved. 32 ᶉͬऔΓύλʔϯ FooClass method1 property1 32 method2 property2 Objec<ve-‐C swi7 FooClassBase rename
FooClass extends Bridging-‐ Header.h +ᶈ࿐ύλʔϯ Copyright (C) DeNA
Co.,Ltd. All Rights Reserved. 32 ᶉͬऔΓύλʔϯ FooClass method1 property1 32 method2 property2 Objec<ve-‐C swi7 property1 method1 ެ։ FooClassBase rename
FooClass extends Bridging-‐ Header.h +ᶈ࿐ύλʔϯ Copyright (C) DeNA
Co.,Ltd. All Rights Reserved. 32 ᶉͬऔΓύλʔϯ FooClass method1 property1 32 method2 property2 Objec<ve-‐C swi7 property1 method1 ެ։ ࢀরɾίʔϧ FooClassBase rename
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 33 objΫϥεΛswiftͰܧঝ໊͠લΛͬऔΔ ᶉͬऔΓύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ⁃ ܧঝͯͬ͠औΔ 33
objΫϥεΛswiftͰܧঝ໊͠લΛͬऔΔ ᶉͬऔΓύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ⁃ ܧঝͯͬ͠औΔ •
ΫϥεຊମΛSwiftʹҠ͠ସ͑ɺطଘobjcΫϥε ΫϥεԽ 33 objΫϥεΛswiftͰܧঝ໊͠લΛͬऔΔ ᶉͬऔΓύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ⁃ ܧঝͯͬ͠औΔ •
ΫϥεຊମΛSwiftʹҠ͠ସ͑ɺطଘobjcΫϥε ΫϥεԽ • ϓϩύςΟϝιουࣗ༝ʹՃՄೳ 33 objΫϥεΛswiftͰܧঝ໊͠લΛͬऔΔ ᶉͬऔΓύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ⁃ ܧঝͯͬ͠औΔ •
ΫϥεຊମΛSwiftʹҠ͠ସ͑ɺطଘobjcΫϥε ΫϥεԽ • ϓϩύςΟϝιουࣗ༝ʹՃՄೳ • ᶈ࿐ύλʔϯͷซ༻Մೳ 33 objΫϥεΛswiftͰܧঝ໊͠લΛͬऔΔ ᶉͬऔΓύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ⁃ ܧঝͯͬ͠औΔ •
ΫϥεຊମΛSwiftʹҠ͠ସ͑ɺطଘobjcΫϥε ΫϥεԽ • ϓϩύςΟϝιουࣗ༝ʹՃՄೳ • ᶈ࿐ύλʔϯͷซ༻Մೳ ⁃ ଥڠϙΠϯτ 33 objΫϥεΛswiftͰܧঝ໊͠લΛͬऔΔ ᶉͬऔΓύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ⁃ ܧঝͯͬ͠औΔ •
ΫϥεຊମΛSwiftʹҠ͠ସ͑ɺطଘobjcΫϥε ΫϥεԽ • ϓϩύςΟϝιουࣗ༝ʹՃՄೳ • ᶈ࿐ύλʔϯͷซ༻Մೳ ⁃ ଥڠϙΠϯτ • ܧঝ͕ؔมߋ͞ΕΔ 33 objΫϥεΛswiftͰܧঝ໊͠લΛͬऔΔ ᶉͬऔΓύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ⁃ ܧঝͯͬ͠औΔ •
ΫϥεຊମΛSwiftʹҠ͠ସ͑ɺطଘobjcΫϥε ΫϥεԽ • ϓϩύςΟϝιουࣗ༝ʹՃՄೳ • ᶈ࿐ύλʔϯͷซ༻Մೳ ⁃ ଥڠϙΠϯτ • ܧঝ͕ؔมߋ͞ΕΔ ⁃ ผղˠ 33 objΫϥεΛswiftͰܧঝ໊͠લΛͬऔΔ ᶉͬऔΓύλʔϯ
FooClass method1 property1 Copyright (C) DeNA Co.,Ltd. All Rights
Reserved. 34 ᶉผղɿͬऔΓύλʔϯ(ΧςΰϦ֦ு) FooClass 34 property2 (Category Extension) Objec<ve-‐C swi7 property1 extensionͰͳ͘ ಉ໊ΫϥεΛSwi7Ͱ ݩͷFooClassΛ objcΧςΰϦ֦ுʹ߱֨
FooClass method1 property1 Copyright (C) DeNA Co.,Ltd. All Rights
Reserved. 34 ᶉผղɿͬऔΓύλʔϯ(ΧςΰϦ֦ு) FooClass 34 property2 (Category Extension) Objec<ve-‐C swi7 property1 extensionͰͳ͘ ಉ໊ΫϥεΛSwi7Ͱ ݩͷFooClassΛ objcΧςΰϦ֦ுʹ߱֨ ☓ͬऔΓݩPCKDʹϓϥΠϕʔτଐੑ͕͋Δ߹ɺ੍ݶଟΊͳͷͰ/(
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ࢀߟɿΞϯνύλʔϯ 35 //ετΞυϓϩύςΟͷՃ
var name:String { get { return objc_getAssociatedObject(self, &key) as! String } set { objc_setAssociatedObject(self, &key, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)} } //ϓϥΠϕʔτϝιουͷ࣮ߦ if respondsToSelector("_reload") { performSelector("_reload") } //ϓϥΠϕʔτϓϩύςΟͷࢀর if let titleLabel = valueForKey("TitleLabel") as? UILabel { ... } • ΧϓηϧԽΛഁյͤͣʹϓϥΠϕʔτ ଐੑΛࢀরɾՃՄೳ • ϝϯςφϯεੑ˚ • ϚϯΨϘοΫεͰۃྗ༻͠ͳ͍Α ͏ʹ͍ͯ͠Δ associatedObject ΩʔίʔσΟϯά objcηϨΫλʔ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 36 ᶊࣸܦύλʔϯ Objec<ve-‐C
swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 36 FooClass
method1 method2 ᶊࣸܦύλʔϯ Objec<ve-‐C swi7
ࣸܦ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 36 FooClass
method1 method2 ᶊࣸܦύλʔϯ Objec<ve-‐C swi7
FooClass method1 method2 ࣸܦ Copyright (C) DeNA Co.,Ltd. All
Rights Reserved. 36 FooClass method1 method2 ᶊࣸܦύλʔϯ Objec<ve-‐C swi7
FooClass method1 method2 ࣸܦ Copyright (C) DeNA Co.,Ltd. All
Rights Reserved. 36 ᶊࣸܦύλʔϯ Objec<ve-‐C swi7
FooClass method1 method2 Copyright (C) DeNA Co.,Ltd. All Rights
Reserved. 36 ᶊࣸܦύλʔϯ Objec<ve-‐C swi7
ᶊࣸܦύλʔϯ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. طଘͷobjcίʔυΛswiftͰॻ͖͢ •
࠷ޙͷखஈ • ςετͷ༗ແͰϦεΫมಈ • ݩίʔυ͕ςετͰอޢ͞Ε͍ͯΔˠ˕ • ରobjcίʔυΛ·ͣςετͰอޢ͔ͯ͠ΒSwiftͰॻ͖͢ˠ̋ • શॻ͖͠ˠ˚ • ͋Δҙຯγϯϓϧ͕ͩɺϑϧQAඞਢɺίετେ 37
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ࢀߟɿࣸܦͷ͓ڙʹ 38 •
Generated Interface
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ࢀߟɿࣸܦͷ͓ڙʹ 39 •
Generated Interface
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ࢀߟɿࣸܦͷ͓ڙʹ 40 •
Generated Interface
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ࢀߟɿࣸܦͷ͓ڙʹ • objc→swift
ίʔυมπʔϧ • https://github.com/yahoojapan/objc2swift • https://objectivec2swift.com/?ref=producthunt#/converter/code • http://iswift.org • https://myappconverter.com • https://itunes.apple.com/us/app/o2swift-objective-c-to-swift/id1060352413?ls=1&mt=12 • ͍ͣΕػցతͳมͳͷͰख͠ˍQAඞਢ 41
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 42 ᶃ Ԇ໋ύλʔϯ
ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ Mix-and-MatchΛͬͨSwiftҠߦύλʔϯ ϦεΫ τϦοΩʔ Swi7Ҡߦ খ େ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Կ͔ʹࣅ͍ͯΔ 43
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Կ͔ʹࣅ͍ͯΔ 44 ᶃ
Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Կ͔ʹࣅ͍ͯΔ 44 ᶃ
Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ h)p://shop.ohmsha.co.jp/shopdetail/000000003881/ ϦϑΝΫλϦϯά
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Կ͔ʹࣅ͍ͯΔ 44 ᶃ
Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ h)p://shop.ohmsha.co.jp/shopdetail/000000003881/ ϦϑΝΫλϦϯά Extract Method Extract Class
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Կ͔ʹࣅ͍ͯΔ 45 ᶃ
Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Կ͔ʹࣅ͍ͯΔ 45 ᶃ
Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ h)p://www.sbcr.jp/products/4797311126.html gof σβΠϯύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Կ͔ʹࣅ͍ͯΔ 45 ᶃ
Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ h)p://www.sbcr.jp/products/4797311126.html gof σβΠϯύλʔϯ Bridgeύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Կ͔ʹࣅ͍ͯΔ 46 ᶃ
Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Կ͔ʹࣅ͍ͯΔ 46 ᶃ
Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ h)p://www.shoeisha.co.jp/book/detail/9784798116839 ϨΨγʔίʔυվળΨΠυ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Կ͔ʹࣅ͍ͯΔ 46 ᶃ
Ԇ໋ύλʔϯ ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ h)p://www.shoeisha.co.jp/book/detail/9784798116839 ϨΨγʔίʔυվળΨΠυ • εϓϥτϝιου • εϓϥτΫϥε • ੩తϝιουͷެ։ ςετίʔυΛॻͨ͘ΊͷϦϑΝΫλϦϯάख๏
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 47 ᶃ Ԇ໋ύλʔϯ
ᶄ ͝৽نύλʔϯ ᶅ Γग़͠ύλʔϯ ᶆ ϒϦοδύλʔϯ ᶇ extensionύλʔϯ ᶈ ࿐ύλʔϯ ᶉ ͬऔΓύλʔϯ ᶊ ࣸܦύλʔϯ Mix-and-MatchΛͬͨSwiftҠߦύλʔϯ طଘͷιϑτΣΞ։ൃٕ๏ͷ׆༻ʹΑΓ εϜʔζɾ҆શʹSwi7ҠߦՄೳ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ·ͱΊ 48
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ·ͱΊ 49
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ·ͱΊ Objective-C͔ΒSwiftԽͷҠߦେมʁ 49
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ·ͱΊ Objective-C͔ΒSwiftԽͷҠߦେมʁ →·ͣ؆୯ͳύλʔϯ͔Βࢼͯ͠ΈΔ
49
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ·ͱΊ Objective-C͔ΒSwiftԽͷҠߦେมʁ →·ͣ؆୯ͳύλʔϯ͔Βࢼͯ͠ΈΔ
• Ԇ໋ύλʔϯ 49
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ·ͱΊ Objective-C͔ΒSwiftԽͷҠߦେมʁ →·ͣ؆୯ͳύλʔϯ͔Βࢼͯ͠ΈΔ
• Ԇ໋ύλʔϯ • ͝৽نύλʔϯ 49
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ·ͱΊ Objective-C͔ΒSwiftԽͷҠߦେมʁ →·ͣ؆୯ͳύλʔϯ͔Βࢼͯ͠ΈΔ
• Ԇ໋ύλʔϯ • ͝৽نύλʔϯ ׳Ε͖ͯͨΒ͍ΖΜͳύλʔϯΛࢼ͢ 49
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ·ͱΊ Objective-C͔ΒSwiftԽͷҠߦେมʁ →·ͣ؆୯ͳύλʔϯ͔Βࢼͯ͠ΈΔ
• Ԇ໋ύλʔϯ • ͝৽نύλʔϯ ׳Ε͖ͯͨΒ͍ΖΜͳύλʔϯΛࢼ͢ ύλʔϯʹ͍ͭͯ͋Ε͜Εߟ͑Δͷָ͍͠ 49
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ·ͱΊ Objective-C͔ΒSwiftԽͷҠߦେมʁ →·ͣ؆୯ͳύλʔϯ͔Βࢼͯ͠ΈΔ
• Ԇ໋ύλʔϯ • ͝৽نύλʔϯ ׳Ε͖ͯͨΒ͍ΖΜͳύλʔϯΛࢼ͢ ύλʔϯʹ͍ͭͯ͋Ε͜Εߟ͑Δͷָ͍͠ ⁃ ଞʹྑ͍ύλʔϯ͕͋Γͦ͏ 49
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ·ͱΊ Objective-C͔ΒSwiftԽͷҠߦେมʁ →·ͣ؆୯ͳύλʔϯ͔Βࢼͯ͠ΈΔ
• Ԇ໋ύλʔϯ • ͝৽نύλʔϯ ׳Ε͖ͯͨΒ͍ΖΜͳύλʔϯΛࢼ͢ ύλʔϯʹ͍ͭͯ͋Ε͜Εߟ͑Δͷָ͍͠ ⁃ ଞʹྑ͍ύλʔϯ͕͋Γͦ͏ ⁃ ໊͔͍͍ͬ͜લر 49
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 50 objc
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 50 objc
swi7 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 50 objc
swi7 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 51 objc
swi7 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 52 objc
swi7
swi7 swi7 swi7 swi7 Copyright (C) DeNA Co.,Ltd. All Rights
Reserved. 53 objc swi7 swi7
objc swi7 swi7 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
54 swi7 swi7 swi7 swi7 swi7 swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 55 swi7
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 56 ਐ
Ͳ ͏ Ͱ ͢ ͔
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ϚϯΨϘοΫεͷݱࡏͷSwiftԽ 17%ఔ ·ͩ·ͩ͜Ε͔Β
57
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ࠓޙͷ༧ଌʢࡶʣ 58 2020
ver5.6 ʹͯSwi7Խ100%౸ୡ༧ఆʢࡶʣʂʂʂ
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 59 Let’s Objc
to Swift !
Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ 60