美文网首页
swift方法参数遵守多继承和遵守多个协议

swift方法参数遵守多继承和遵守多个协议

作者: Theshy | 来源:发表于2018-03-27 19:08 被阅读400次

参数继承协议

OC中

id<delegate>

Swift 3

protocol<A, B>

Swift 4

A & B

    open func contactPicker(from viewController: UIViewController & WYContactDelegate, completion: (() -> Void)? = nil) {
        delegate = viewController
        handle.contactPicker(from: viewController, completion: completion)
    }
多协议

文档

相关文章

网友评论

      本文标题:swift方法参数遵守多继承和遵守多个协议

      本文链接:https://www.haomeiwen.com/subject/rdwscftx.html