as? vs is
Here’s the code if you want to experiment with it!
let mystery: Any = Bool.random() ? 1 : "One"
if mystery is Int {
print("It's an Int!")
}
Here’s the code if you want to experiment with it!
let mystery: Any = Bool.random() ? 1 : "One"
if mystery is Int {
print("It's an Int!")
}