[Swift] typealias

2023. 3. 4. 12:25🍏/Swift

Typealias
타입의 별명을 지정

typealias

 

typealias Coordinate = (x: Int, y: Int)
typealias Size = Int
typealias Vactor = (Coordinate, Size)
typealias Force = (() -> (Void))
func weight() {print("W")}
func calculate(_ vactor: Vactor) -> Force {return weight}
let c = calculate(((0, 0), 0))
c()