Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 13 revealed textField on UISearchBar #57

Closed
olejnjak opened this issue Nov 29, 2019 · 3 comments
Closed

iOS 13 revealed textField on UISearchBar #57

olejnjak opened this issue Nov 29, 2019 · 3 comments

Comments

@olejnjak
Copy link
Member

So we can use it natively instead of our hack 🎉

var textField: UITextField! { return value(forKey: "searchField") as? UITextField }

@janmisar
Copy link
Member

But only for 13+ 😬 Removal is breaking change which is not good so I suggest just to deprecate this and we're done.

@olejnjak
Copy link
Member Author

I think that the same approach as view use for view.safeArea is optimal, at least for now.

public var safeArea: UILayoutGuide {

@olejnjak
Copy link
Member Author

olejnjak commented Dec 8, 2019

Finally implemented in #61 in a bit different way as @LukasHromadnik suggested. The implementation is as discussed here, it uses searchTextField on iOS 13+, on older systems it uses the old value(forKey:) method.

In addition it is marked to be deprecated on iOS 13+, so it reports a deprecation warning if deployment target is iOS 13+ (we should do this also for the UIView.safeArea), otherwise it compiles without any warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants