Slide 1

Slide 1 text

SWIFT VS. OBJECTIVE-C THE EPIC BATTLE

Slide 2

Slide 2 text

OBJECTIVE-C: STILL REALLY FUN.

Slide 3

Slide 3 text

- (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)

Slide 4

Slide 4 text

▸ Super dynamic ▸ Meta-programmable ▸ More mature ▸ Strong ecosystem support

Slide 5

Slide 5 text

SWIFT IS PRETTY AWESOME.

Slide 6

Slide 6 text

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 }

Slide 7

Slide 7 text

▸ Type safety ▸ Generics ▸ Succinctness ▸ Beautiful "block" syntax

Slide 8

Slide 8 text

OBJECTIVE-C: LIKELY NOT "THE FUTURE."

Slide 9

Slide 9 text

▸ Not going anywhere ▸ Not getting any better ▸ Solid, but stuck in the past

Slide 10

Slide 10 text

SWIFT: STILL WITH SOME WARTS.

Slide 11

Slide 11 text

▸ Compiler has a couple of bugs ▸ Works with 90% of UIKit/Foundation well ▸ CocoaPods support forthcoming ▸ Banner features still need some TLC

Slide 12

Slide 12 text

WHY CHOOSE?

Slide 13

Slide 13 text

SPOILER ALERT: YOU MIGHT NOT NEED TO

Slide 14

Slide 14 text

▸ Interoperability still an option, albeit tricky ▸ "Pure Swift" projects are easiest to manage

Slide 15

Slide 15 text

BUT IF I HAD TO?

Slide 16

Slide 16 text

Learn Objective-C first, then Swift. Build a few Objective-C apps first, then some Swift ones.

Slide 17

Slide 17 text

REALLY? NOT NECESSARILY.

Slide 18

Slide 18 text

If you're comfortable digging into Swift first, do it.

Slide 19

Slide 19 text

Objective-C is worth learning, even if it's not the future.