Skip to content

Instantly share code, notes, and snippets.

@TadeasKriz
Last active December 15, 2017 14:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TadeasKriz/a1127e64a04301417cd3b71aa78e485b to your computer and use it in GitHub Desktop.
Save TadeasKriz/a1127e64a04301417cd3b71aa78e485b to your computer and use it in GitHub Desktop.
UIPickerView workaround for white background being set automatically when used as inputView of UITextField with keyboardAppearance set to .Dark.
class UIPickerViewWorkaround: UIPickerView {
override func respondsToSelector(aSelector: Selector) -> Bool {
if aSelector.description == "_appearanceContainer" {
return false
} else {
return super.respondsToSelector(aSelector)
}
}
}
@dungi
Copy link

dungi commented Dec 15, 2017

Should be: responds(to aSelector: Selector!) for new Swift Version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment