I have model for my class that may be instance of 2 different classes. Now i check that model is class i need with following:
guard let unwrappedModel = store.state.navigationState.getRouteSpecificState(store.state.navigationState.route) as myClassOne? else {
assertionFailure("Wrong model for RetailSalesVC")
return
}
Now i want to check if model is class one OR model is class two. Is that possible to achieve?
Now i ended up with this (but without optional binding):
guard (((store.state.navigationState.getRouteSpecificState(store.state.navigationState.route) as MyClassOne?) != nil)) ||
(((store.state.navigationState.getRouteSpecificState(store.state.navigationState.route) as MyClassTwo?) != nil)) else {
assertionFailure("Wrong model for \(self)")
return
}