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
0
61
Swift vs. Objective-C
Not really an epic battle.
Ben Kreeger
December 05, 2014
Tweet
Share
More Decks by Ben Kreeger
See All by Ben Kreeger
Factory Girl
kreeger
0
75
Liberty STEM App Camp introduction
kreeger
0
95
Other Decks in Programming
See All in Programming
Rollupのビルド時間高速化によるプレビュー表示速度改善とバンドラとASTを駆使したプロダクト開発の難しさ
plaidtech
PRO
1
140
Chrome Extension Techniques from Hell
moznion
1
150
アーキテクトと美学 / Architecture and Aesthetics
nrslib
12
3.2k
Going Structural with Named Tuples
bishabosha
0
190
AI Coding Agent Enablement - エージェントを自走させよう
yukukotani
12
4.5k
いまさら聞けない生成AI入門: 「生成AIを高速キャッチアップ」
soh9834
14
4.2k
アプリを起動せずにアプリを開発して品質と生産性を上げる
ishkawa
0
2.2k
Vibe Codingをせずに Clineを使っている
watany
14
4.8k
WordPress Playground for Developers
iambherulal
0
120
これだけは知っておきたいクラス設計の基礎知識 version 2
masuda220
PRO
20
4.6k
php-fpm がリクエスト処理する仕組みを追う / Tracing-How-php-fpm-Handles-Requests
shin1x1
5
890
プログラミング教育のコスパの話
superkinoko
0
130
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
7
630
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.6k
Visualization
eitanlees
146
16k
KATA
mclloyd
29
14k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Statistics for Hackers
jakevdp
798
220k
The World Runs on Bad Software
bkeepers
PRO
67
11k
GraphQLの誤解/rethinking-graphql
sonatard
70
10k
Designing Experiences People Love
moore
141
23k
GraphQLとの向き合い方2022年版
quramy
45
14k
The Cost Of JavaScript in 2023
addyosmani
48
7.6k
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.