- (id)initWithAnnotation:(id<MKAnnotation>)annotation
reuseIdentifier:(NSString *)reuseIdentifier
delegate:(id<CallOutAnnotationViewDelegate>)delegate;
以上是Objective C Code,如何用swift写?
答案 0 :(得分:0)
使用此: //像这样定义你的功能
func initWithAnnotation(annotation:MKAnnotation, reuseIdentifier:String, completion: ()->Void) {
//Your implementation goes here
//for call back
completion()
}
//通过以下方式调用上面的函数:
self.initWithAnnotation(Your_MKProtocol, reuseIdentifier: "identifier", completion: {
//Your call back implementations
//Similar to delegate callback
})