public typealias SwiperData = (image: UIImage,Title: String)public struct SwiperPeekVIEwControllers{ public var parentVIEwController: UIVIEwController! public var contentVIEwController: UIVIEwController! public init(parentVC: UIVIEwController,contentVC: UIVIEwController){ parentVIEwController = parentVC contentVIEwController = contentVC }}
协议
@objc public protocol SwiperPeekVIEwDelegate: class{ func dIDUndoAction(index: Int,dataSource: SwiperData) // Method cannot be a member of an @objc protocol because the type of the parameter 2 cannot be represented in Objective-C func swiperPeekVIEwControllers()->SwiperPeekVIEwControllers func swiperPeekVIEwSize()->CGSize }解决方法 您不能将typealiases导出到Objective-C.你不能为元组做这件事.但是,关于typealias,仍然可以为某些结构编写Obj-C typedef并从Swift中使用它,它将作为typealias导出 总结
以上是内存溢出为你收集整理的swift – 如何使struct和typealias符合@objc全部内容,希望文章能够帮你解决swift – 如何使struct和typealias符合@objc所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)