I left the cast in
let viewSize = (view as! UIView).bounds.size
since in the switch case I already check the class of 'view' using
case .viewAspectRatio where view is UIView:
By doing this if the view is not a UIView, it automatically switch to default case.
Let me know if it's fine or if you prefer the guard approach, I'll be happy to modify if needed.
I left the cast in
let viewSize = (view as! UIView).bounds.size
since in the switch case I already check the class of 'view' usingcase .viewAspectRatio where view is UIView:
By doing this if the view is not a UIView, it automatically switch to default case. Let me know if it's fine or if you prefer the guard approach, I'll be happy to modify if needed.Regards, Giacomo