mirror of
https://github.com/zhigang1992/facebook-ios-sdk.git
synced 2026-05-13 04:00:56 +08:00
Summary: This diff modernizes the `FBSDKCoreKit` to support modern Objective-C syntax to increase type safety with both ObjC and Swift. **General Changes** * Removed Deprecated Methods, Classes, Properties * Typedefs for all Objective-C blocks * Used `instancetype` for inits * Updated Xcode Projects/Schemes via. "Validate Project" option in Xcode * Made `init`/`new` unavailable where/when possible * Confirm `NSError **` throws on Swift * Used `NS_SWIFT_UNAVAILABLE` where makes sense * Ensured `NS_DESIGNATED_INITIALIZER` is used * Added `NS_TYPED_EXTENSIBLE_ENUM` where made sense **Updated Properties** * Changed getter methods to `readonly` properties * Changed getter/setter methods to `readwrite` properties * Changed singletons to class properties * Used dot notation for access to properties * Added `getter=` for certain properties (e.g. `BOOL`) **Added Nullability Annotations** * Used `NS_ASSUME_NONNULL_BEGIN` & `NS_ASSUME_NONNULL_END` for files * Used `_Nullable` for typedef blocks * Used `nullable` & `null_resettable` * Collections/Dictionaries `nonnull` when at all possible **Added Generics** * `NSArray` & `NSMutableArray` * `NSSet` & `NSMutableSet` * `NSDictionary` & `NSMutableDictionary` **Added `NS_SWIFT_NAME`** * Removed prefixes in favor of Swift namespaces * `FB` prefix for UI elements * Added Dot notation where makes sense * Swift init for class method creation methods Reviewed By: jingping2015 Differential Revision: D9235744 fbshipit-source-id: 29ce09ca50f68755b65b65e54a37d1fd65991d2d