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.1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SwiftFriendlyObjective-C/try! Swift Tokyo 2017 RejectCon
https://rmp-quipper.connpass.com/event/49316/
Noritaka Kamiya
February 28, 2017
More Decks by Noritaka Kamiya
See All by Noritaka Kamiya
キラリと光るテクニック、アプリをデモするときの心構え/iOSDC Japan 2018
nolili
4
3.7k
WWDC Pre meeting
nolili
1
3.5k
FastLane with Swift
nolili
0
190
App Transport Securityとローカルネットワーキング/iOSDC Japan 2017
nolili
1
1.7k
iOS Test Night #4
nolili
0
4.2k
iOSアプリ開発のCI/CD環境とユビレジでのtry / CI CDNight
nolili
1
1.8k
ユビレジiOSアプリ開発のCI/CD環境 / iOS Test Night #1
nolili
5
2.5k
Modern Core Data(iOS 10)
nolili
0
1.4k
iOS I/O 2016 アクセサリといっしょ
nolili
1
2.2k
Other Decks in Programming
See All in Programming
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
180
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
240
ソフトウェアラスタライザ
fadis
1
730
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
160
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
440
How I Won Prize Money at a Hackathon Using Codex and Symphony Alpha
yasei_no_otoko
0
130
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
540
Loosening the Reins: Go Generics Get More Flexible
kuro_kurorrr
0
350
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.3k
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
420
typoなんかねぇよ
raspython3
0
610
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
120
Featured
See All Featured
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
It's Worth the Effort
3n
188
29k
Automating Front-end Workflow
addyosmani
1369
210k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
630
The SEO Collaboration Effect
kristinabergwall1
1
530
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
710
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
690
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
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