Swift: Type casting

Type casting is used to check the type of an instance , to check whether a type conform to a protocol or to treat that instance as a different superclass or subclass from somewhere else in its own class hierarchy. Type casting in Swift is done by using is and as operators.

Leave a Reply