The Swift language has three casting operators: is, as?, and as!.
asserves a different role and its behavior will not be specifically discussed in this document.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 types generally follow standard object-oriented casting conventions.
Objective-C and CoreFoundation (CF) types follow the behaviors expected from Objective-C.