Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Breaking changes for Foundation API

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Breaking changes for Foundation API

Avatar for Kishikawa Katsumi

Kishikawa Katsumi

July 14, 2015
Tweet

More Decks by Kishikawa Katsumi

Other Decks in Programming

Transcript

  1. nilΛ୅ೖ͢Δͱྫ֎ => ཁૉͷ࡟আ NSMutableDictionary<NSString *, NSNumber *> *dic = [[NSMutableDictionary

    alloc] init]; dic[@"key"] = @(1); NSLog(@"%@", dic); // => {"key": 1} dic[@"key"] = nil; NSLog(@"%@", dic); // => {}
  2. NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init]; dictionary[@"id"] = model.identifier; if

    (self.name) { dictionary[@"name"] = model.name; } if (self.email) { dictionary[@"email"] = model.email; }
  3. #if !defined(SWIFT_CLASS_EXTRA) || (defined(SWIFT_SDK_OVERLAY_FOUNDATION_EPOCH) && SWIFT_SDK_OVERLAY_FOUNDATION_EPOCH >= 5) - (nullable

    id)decodeObjectOfClasses:(nullable NSSet<Class> *)classes forKey:(NSString *)key NS_AVAILABLE(10_8, 6_0) NS_REFINED_FOR_SWIFT; #else - (nullable id)decodeObjectOfClasses:(nullable NSSet<Class> *)classes forKey:(NSString *)key NS_AVAILABLE(10_8, 6_0); #endif