Objective-C新特性
Modules
@import UIKit.UIView;Nullability
@property (nonatomic, strong, nonnull) Sark *sark;
@property (nonatomic, copy, readonly, nullable) NSArray *friends;
+ (nullable NSString *)friendWithName:(nonnull NSString *)name;- (void)startWithCompletionBlock:(nullable void (^)(NSError * _Nullable error))block;@property (null_resettable, nonatomic, strong) UIView *view;NS_ASSUME_NONNULL_BEGIN
@interface Sark : NSObject
@property (nonatomic, copy, nullable) NSString *workingCompany;
@property (nonatomic, copy) NSArray *friends;
- (nullable NSString *)gayFriend;
@end
NS_ASSUME_NONNULL_END__kindof
泛型
带泛型的容器
自定义泛型
covariant && contravariant
Designated Initializer
Last updated
Was this helpful?