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
Swift vs. Objective-C
Search
Ben Kreeger
December 05, 2014
Programming
70
0
Share
Swift vs. Objective-C
Not really an epic battle.
Ben Kreeger
December 05, 2014
More Decks by Ben Kreeger
See All by Ben Kreeger
Factory Girl
kreeger
0
82
Liberty STEM App Camp introduction
kreeger
0
99
Other Decks in Programming
See All in Programming
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
380
JavaDoc 再入門
nagise
0
190
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
220
Oxlintのカスタムルールの現況
syumai
5
810
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
380
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
290
~ 秘伝のタレ化した『神スプシ』と戦う ~ 関数型パラダイムで壊れない仕組みへ
h0r15h0
1
140
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
110
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
130
net-httpのHTTP/2対応について
naruse
0
200
inferと仲良くなる10分間
ryokatsuse
1
270
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
230
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
140
The Cult of Friendly URLs
andyhume
79
6.9k
Practical Orchestrator
shlominoach
191
11k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Odyssey Design
rkendrick25
PRO
2
640
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
170
Leo the Paperboy
mayatellez
7
1.8k
For a Future-Friendly Web
brad_frost
183
10k
Paper Plane
katiecoart
PRO
1
50k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Navigating Weather and Climate Data
rabernat
0
200
Game over? The fight for quality and originality in the time of robots
wayneb77
1
180
Transcript
SWIFT VS. OBJECTIVE-C THE EPIC BATTLE
OBJECTIVE-C: STILL REALLY FUN.
- (void)updateWithDictionary:(NSDictionary *)dictionary context:(NSManagedObjectContext *)context { [self.remoteToLocalAttributeMap each:^(NSString *remoteName, NSString
*localName) { id remoteValue = dictionary[remoteName]; if ([(NSNull *)remoteValue isEqual:[NSNull null]]) return; if (self.remoteDateFormats[remoteName]) { remoteValue = [NSDate dateFromString:remoteValue format:self.remoteDateFormats[remoteName]]; } [self setValue:remoteValue forKeyPath:localName]; }]; } (Yes, this is fun)
▸ Super dynamic ▸ Meta-programmable ▸ More mature ▸ Strong
ecosystem support
SWIFT IS PRETTY AWESOME.
private func createOrUpdateLocations(dicts: [NSDictionary]) -> [SaucerLocation] { let realm =
RLMRealm.defaultRealm() var locations = [SaucerLocation]() realm.transactionWithBlock() { for dict in dicts { var instance = SaucerLocation.findOrCreate(dictionary: dict, inRealm: realm) locations.append(instance) } } return locations }
▸ Type safety ▸ Generics ▸ Succinctness ▸ Beautiful "block"
syntax
OBJECTIVE-C: LIKELY NOT "THE FUTURE."
▸ Not going anywhere ▸ Not getting any better ▸
Solid, but stuck in the past
SWIFT: STILL WITH SOME WARTS.
▸ Compiler has a couple of bugs ▸ Works with
90% of UIKit/Foundation well ▸ CocoaPods support forthcoming ▸ Banner features still need some TLC
WHY CHOOSE?
SPOILER ALERT: YOU MIGHT NOT NEED TO
▸ Interoperability still an option, albeit tricky ▸ "Pure Swift"
projects are easiest to manage
BUT IF I HAD TO?
Learn Objective-C first, then Swift. Build a few Objective-C apps
first, then some Swift ones.
REALLY? NOT NECESSARILY.
If you're comfortable digging into Swift first, do it.
Objective-C is worth learning, even if it's not the future.