How do I declare typedef in Swift

esh picture esh · Jun 6, 2014 · Viewed 36.1k times · Source

If I require a custom type in Swift, that I could typedef, how do I do it? (Something like a closure syntax typedef)

Answer

Anil Varghese picture Anil Varghese · Jun 6, 2014

The keyword typealias is used in place of typedef

typealias CustomType = String
var customString:CustomType = "Test String"