A variable can be downcasted to a subtype using the type cast operators as?, and as!.
The as? operator attempts to cast to a subtype.
It can fail, therefore it returns an optional.
let value: Any = "John"
let name = value as? String
print(name) // prints Optional("John")
...