Slide 1

Slide 1 text

Breaking changes for Foundation API in iOS 9

Slide 2

Slide 2 text

https://github.com/kishikawakatsumi/ Kishikawa Katsumi http://kishikawakatsumi.hatenablog.com/

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Next Realm Meetup • 7/23ʢ໦ʣ • 19:00ʙ • Sansanגࣜձࣾ

Slide 5

Slide 5 text

NSMutableDictionary - (void)setObject:(nullable ObjectType)obj forKeyedSubscript:(KeyType )key Xcode 7beta

Slide 6

Slide 6 text

NSMutableDictionary - (void)setObject:(nullable ObjectType)obj forKeyedSubscript:(KeyType )key Xcode 7beta

Slide 7

Slide 7 text

nilΛ୅ೖ͢Δͱྫ֎ => ཁૉͷ࡟আ NSMutableDictionary *dic = [[NSMutableDictionary alloc] init]; dic[@"key"] = @(1); NSLog(@"%@", dic); // => {"key": 1} dic[@"key"] = nil; NSLog(@"%@", dic); // => {}

Slide 8

Slide 8 text

Xcode 6.x dic[@"key"] = nil; // NSInvalidArgumentException

Slide 9

Slide 9 text

NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init]; dictionary[@"id"] = model.identifier; if (self.name) { dictionary[@"name"] = model.name; } if (self.email) { dictionary[@"email"] = model.email; }

Slide 10

Slide 10 text

NS_REFINED_FOR_SWIFT Xcode 7beta

Slide 11

Slide 11 text

#if !defined(SWIFT_CLASS_EXTRA) || (defined(SWIFT_SDK_OVERLAY_FOUNDATION_EPOCH) && SWIFT_SDK_OVERLAY_FOUNDATION_EPOCH >= 5) - (nullable id)decodeObjectOfClasses:(nullable NSSet *)classes forKey:(NSString *)key NS_AVAILABLE(10_8, 6_0) NS_REFINED_FOR_SWIFT; #else - (nullable id)decodeObjectOfClasses:(nullable NSSet *)classes forKey:(NSString *)key NS_AVAILABLE(10_8, 6_0); #endif