In Swift you can check the class type of an object using \'is\'. How can I incorporate this into a \'switch\' block?
I think it\'s not possible, so I\'m wondering w
I like this syntax:
switch thing {
case _ as Int: print("thing is Int")
case _ as Double: print("thing is Double")
}
since it gives you the possibility to extend the functionality fast, like this:
switch thing {
case let myInt as Int: print("\(myInt) is Int")
case _ as Double: print("thing is Double")
}