I'm trying to do the equivalent of this but in Swift and I'm running into problems:
- No equivalent of
try/catch
blocks in swift - The
if
statement never seems to be evaluated as true
Here is what I've put together so far:
for searchBarSubview in self.searchBar!.subviews {
if (searchBarSubview.conformsToProtocol(UITextInputTraits)) {
var searchBarTextField = searchBarSubview as UITextField
searchBarTextField.returnKeyType = UIReturnKeyType.Done
}
}
Does anyone have any ideas where I'm going wrong?