草庐IT

YDBlutoothToolContectedList

全部标签

ios - 在 swift 中使用 Objective-C block

我的swift项目中有一个第三方Objective-C库,在其中一个.h文件中,它有一个typedef:typedefvoid(^YDBlutoothToolContectedList)(NSArray*);在类内部,它有一个属性:@property(nonatomic,copy)YDBlutoothToolContectedListblutoothToolContectedList;(请忽略它的拼写)当我尝试在我的swift类中使用这个属性时,我使用bt.blutoothToolContectedList={(_tempArray:[Any])->Voidinself.devices