خرید بک لینک

Vote count: 0

I've got an objective c API defined like this:

- (instancetype)initWithItems:(NSArray *)items reuseIdentifier:(NSString *)reuseIdentifier configuration:(void(^)(id item, id cell, NSIndexPath *indexPath))configuration;

This translates into Swift like this:

public init!(items: [AnyObject]!, reuseIdentifier: String!, configuration: ((AnyObject!, AnyObject!, NSIndexPath!) -> Void)!)

Now, I'd like to use this API with an Array of swift structs, but unfortunately I caot cast the structs to AnyObject. Is there any way to write an Objc API with an id type that translates to the swift type Any so that I can use both a swift class and a struct?

asked 12 secs ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 2 مرداد 1395 ساعت: 9:41

صفحه بندی