【发布时间】:2016-03-17 11:31:39
【问题描述】:
是否可以做到以下几点:
protocol A: class {
typealias T: AnyObject
}
extension A {
func testA(a:Self, _ t:T)->Void{
print(a, t)
}
}
class B:A {
typealias T = String
}
换句话说,我有协议并且想在符合它的类中提供具体类型。
【问题讨论】:
标签: swift oop swift2 swift-protocols