Swift-关键字

149 阅读1分钟

typealias

重命名

https://swifter.tips/typealias/

associatedtype

关联对象

protocol Entertainment {  
    associatedtype MediaType  
}

class Foo : Entertainment {  
    typealias MediaType = String //可以指定任意类型
}

@discardableResult

忽略返回值