The Swift language has three casting operators: isas?, and as!.

Except where noted, casting between types described in different sections below will always fail -- for example, casting a struct instance to a function type or vice-versa.

Class and Foreign Types


Class types generally follow standard object-oriented casting conventions.

Objective-C and CoreFoundation (CF) types follow the behaviors expected from Objective-C.

자료

swift/DynamicCasting.md at main · apple/swift