How to implement @property (class, read-only, copy, non-atomic) NSArray <NSString *> * _Nullable readableTypeIdentifiersForItemProvider;

Try to implement the NSItemProviderReading protocol. In Objective-C, how do you satisfy:

 @property(class, readonly, copy, nonatomic) NSArray<NSString *> * _Nullable readableTypeIdentifiersForItemProvider; 

I assume he wants an NSArray with UTI, but the class reference casts me away.

+5
source share
1 answer

This is a class property, so we will start with + . It returns NSArray * , the name readableTypeIdentifiersForItemProvider . Therefore, the getter will be:

 + (NSArray<NSString *> * _Nullable)readableTypeIdentifiersForItemProvider { return @[@"id1", @"id2"]; } 

This property is a readonly , so we do not need a setter.

+6
source

Source: https://habr.com/ru/post/1269402/


All Articles