Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Trying implement NSItemProviderReading protocol. In Objective-C, how do you satisfy:

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

I assume it wants NSArray with UTI, but the class reference is throwing me off.

like image 858
Aron Nelson Avatar asked Jul 01 '17 18:07

Aron Nelson


1 Answers

It's a class property, therefore we will start with +. It returns an NSArray *, the name is readableTypeIdentifiersForItemProvider. Therefore the getter will be:

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

It's a readonly property, therefore we don't need a setter.

like image 148
Sulthan Avatar answered Oct 25 '22 02:10

Sulthan