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
SwiftFriendlyObjective-C/try! Swift Tokyo 2017 ...
Search
Noritaka Kamiya
February 28, 2017
Programming
1
930
SwiftFriendlyObjective-C/try! Swift Tokyo 2017 RejectCon
https://rmp-quipper.connpass.com/event/49316/
Noritaka Kamiya
February 28, 2017
Tweet
Share
More Decks by Noritaka Kamiya
See All by Noritaka Kamiya
キラリと光るテクニック、アプリをデモするときの心構え/iOSDC Japan 2018
nolili
4
3.3k
WWDC Pre meeting
nolili
1
3.4k
FastLane with Swift
nolili
0
160
App Transport Securityとローカルネットワーキング/iOSDC Japan 2017
nolili
1
1.5k
iOS Test Night #4
nolili
0
3.9k
iOSアプリ開発のCI/CD環境とユビレジでのtry / CI CDNight
nolili
1
1.7k
ユビレジiOSアプリ開発のCI/CD環境 / iOS Test Night #1
nolili
5
2.4k
Modern Core Data(iOS 10)
nolili
0
1.3k
iOS I/O 2016 アクセサリといっしょ
nolili
1
2k
Other Decks in Programming
See All in Programming
AIともっと楽するE2Eテスト
myohei
7
2.9k
AI コーディングエージェントの時代へ:JetBrains が描く開発の未来
masaruhr
1
200
AIと”コードの評価関数”を共有する / Share the "code evaluation function" with AI
euglena1215
1
170
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
550
20250704_教育事業におけるアジャイルなデータ基盤構築
hanon52_
5
880
A full stack side project webapp all in Kotlin (KotlinConf 2025)
dankim
0
130
RailsGirls IZUMO スポンサーLT
16bitidol
0
190
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
1
6.5k
Deep Dive into ~/.claude/projects
hiragram
14
7k
チームのテスト力を総合的に鍛えて品質、スピード、レジリエンスを共立させる/Testing approach that improves quality, speed, and resilience
goyoki
5
990
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
280
システム成長を止めない!本番無停止テーブル移行の全貌
sakawe_ee
1
220
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
6
320
Thoughts on Productivity
jonyablonski
69
4.7k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
740
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
830
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Music & Morning Musume
bryan
46
6.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Typedesign – Prime Four
hannesfritz
42
2.7k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Transcript
SwiftϑϨϯυϦʔObjective-C @nolili Noritaka Kamiya
None
None
None
None
Swift❤ Objective-C❤
try! Swift SwiftϑϨϯυϦʔObjective-C
try! Swift EXC_BAD_INSTRUCTION
try! Swift EXC_BAD_INSTRUCTION Rejected
Swift❤ Objective-C❤
جຊ
Nullability
@interface Memo : NSObject @property (nonatomic) NSDate *createdAt; @property (nonatomic)
NSString *text; @property (nonatomic) NSArray *images; @end Nullability
Nullability open class Memo : NSObject { open var createdAt:
Date! open var text: String! open var images: [Any]! }
@interface Memo : NSObject @property (nonatomic, nonnull) NSDate *createdAt; @property
(nonatomic, nonnull) NSString *text; @property (nonatomic, nonnull) NSArray *images; @end Nullability
open class Memo : NSObject { open var createdAt: Date
open var text: String open var images: [Any] } Nullability
NS_ASSUME_NONNULL_BEGIN @interface Memo : NSObject @property (nonatomic) NSDate *createdAt; @property
(nonatomic) NSString *text; @property (nonatomic) NSArray *images; @end NS_ASSUME_NONNULL_END Nullability
LightWeight Generics
LightWeight Generics NS_ASSUME_NONNULL_BEGIN @interface Memo : NSObject @property (nonatomic) NSDate
*createdAt; @property (nonatomic) NSString *text; @property (nonatomic) NSArray *images; @end NS_ASSUME_NONNULL_END
open class Memo : NSObject { open var createdAt: Date
open var text: String open var images: [Any] } Nullability
LightWeight Generics NS_ASSUME_NONNULL_BEGIN @interface Memo : NSObject @property (nonatomic) NSDate
*createdAt; @property (nonatomic) NSString *text; @property (nonatomic) NSArray<UIImage *> *images; @end NS_ASSUME_NONNULL_END
LightWeight Generics open class Memo : NSObject { open var
createdAt: Date open var text: String open var images: [UIImage] }
ΞϊςʔγϣϯͰSwiftଆؾ࣋ͪΛද໌͢Δ
Blocks / Closure
memo.save { _ in } TrailingClosure typedef void (^SomeCompletionHandler)(NSString *);
@interface Memo : NSObject - (void)save:(SomeCompletionHandler)handler; @end
Closure typedef void (^SomeCompletionHandler)(NSString *); @interface Memo : NSObject -
(void)save:(nullable SomeCompletionHandler)handler; @end memo.save()
noescape typedef void (^SomeCompletionHandler)(NSString *); @interface Notes : NSObject +
(void)save:(__attribute__((noescape)) SomeCompletionHandler)handler; @end memo.save { _ in someSelfMethod() // self. ෆཁ }
Error/Exception
Error + (BOOL)send:(NSError **)error; open class func send() throws
@throw @try @catch @finally
@throw @try @catch @finally X
w $PEJOH(VJEFMJOFTGPS$PDPBʹԊͬͯॻ͘ w (FOFSBUFE*OUFSGBDFΛΈΔ w 4UBUJD"OBMZ[FSΛ׆༻͢Δ w 4XJGU͔ΒJNQPSUͯ͠ΈΔ w ͔͍͍ͬ͜0CKFDUJWF$4XJGU͔ΒΈ͔͍͍ͯͬ͜
৺͕͚͍ͯΔ͜ͱ
None
None
None
None
w $PDPBίʔσΟϯάΨΠυϥΠϯʹԊͬͯॻ͘ w (FOFSBUFE*OUFSGBDFΛΈΔ w 4UBUJD"OBMZ[FSΛ׆༻͢Δ w 4XJGU͔ΒJNQPSUͯ͠ΈΔ w ͔͍͍ͬ͜0CKFDUJWF$4XJGU͔ΒΈ͔͍͍ͯͬ͜
৺͕͚͍ͯΔ͜ͱ
SwiftϑϨϯυϦʔObjective-C @nolili Noritaka Kamiya