$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
iOSレガシーコード改善ガイド〜マンガボックス開発における事例〜
Search
kenmaz
January 29, 2016
Programming
1
410
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.2k
Xcode PreviewsからSnapshotテストを自動生成する
kenmaz
1
510
Xcode Previews でUIKitベースのアプリ開発を効率化する - iOSDC Japan 2020
kenmaz
12
13k
モバイル決済アプリの作り方 / How to develop a mobile payment app
kenmaz
6
7.9k
Developing Apple Pay In-App Provisioning in merpay
kenmaz
6
2.1k
Developing Apple Pay In-App Provisioning
kenmaz
6
2.2k
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
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
850
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
150
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
580
N.E.X.T LEVEL
pluu
2
270
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
130
Java 23の概要とJava Web Frameworkの現状 / Java 23 and Java web framework
kishida
2
380
StarlingMonkeyを触ってみた話 - 2024冬
syumai
2
180
あれやってみてー駆動から成長を加速させる / areyattemite-driven
nashiusagi
1
160
layerx_20241129.pdf
kyoheig3
2
260
Thoughts and experiences on Rust and TypeScript
unvalley
2
220
我々のデザインシステムは Chakra v3 にアップデートします
shunya078
2
2.9k
Seamless Flutter Native Integration: FFI & Pigeon - Dreamwalker (JaichangPark / 박제창) @FlutterKaigi2024
itsmedreamwalker
0
120
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Bash Introduction
62gerente
608
210k
Optimizing for Happiness
mojombo
376
70k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
We Have a Design System, Now What?
morganepeng
51
7.3k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.8k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
How to train your dragon (web standard)
notwaldorf
88
5.7k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
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