Swift 3.0 中 protocol 中怎么添加可选方法? 类似 OC 中的 optional? 财富值1

2016-10-13 14:42发布

protocol ExampleProtocol {

var simpleDescription: String { get } mutating func adjust()   

}

困惑好久了,求助啊!~

付费偷看设置
发送
2条回答
bobomao - 这个人很懒,什么都没留下
1楼 · 2016-10-13 14:49.采纳回答

可通过extension实现.

之前optional之前是不用加@objc,貌似3.0不加会编译不通过

一周热门 更多>