December 2018
Intermediate to advanced
414 pages
10h 19m
English
Let's craft a class especially for our demonstration purposes. It has the following features:
Consider the following MyGeneric class:
NS_ASSUME_NONNULL_BEGIN@interface MyGeneric<__covariant T> : NSObject@property (nullable, nonatomic, retain) NSArray<T> *genericArray;- (NSArray *)untypedArray;- (NSArray<NSString *> *)stringArray;- (NSArray<__kindof NSString *> *)kindofStringArray;@endNS_ASSUME_NONNULL_END
The previous code is a fully generic Objective-C class and introduces two new keywords:
Read now
Unlock full access