SyntaxFix
Write A Post
Hire A Developer
Questions
You can combine the check and cast into one statement:
let touch = object.anyObject() as UITouch if let picker = touch.view as? UIPickerView { ... }
Then you can use picker within the if block.
picker
if