I'm trying to do the equivalent of this but in Swift and I'm running into problems:
try/catch
blocks in swiftif
statement never seems to be evaluated as trueHere 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?
To change return type of UISearchBar in swift
searchBar.returnKeyType = UIReturnKeyType.Done
Other Enum
case Default
case Go
case Google
case Join
case Next
case Route
case Search
case Send
case Yahoo
case Done
case EmergencyCall
@available(iOS 9.0, *)
case Continue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With