Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

iOS13调用valueForKey:@"_searchField"崩溃 #119

Open
fanjiduo opened this issue Sep 26, 2019 · 1 comment
Open

iOS13调用valueForKey:@"_searchField"崩溃 #119

fanjiduo opened this issue Sep 26, 2019 · 1 comment

Comments

@fanjiduo
Copy link

升级iOS13以后,在UISearchBar+Keyboard中的- (instancetype)dk_init方法,执行UITextField *searchField = [obj valueForKey:@"_searchField"];会闪退。
希望解决一下,谢谢。

@fanjiduo
Copy link
Author

fanjiduo commented Sep 26, 2019

iOS13以后,可以直接调用searchTextField了,可以改为:
UITextField *searchField;
if ([[[UIDevice currentDevice]systemVersion] floatValue] >= 13.0) {
searchField = self.searchTextField;
} else {
searchField = [self valueForKey:@"_searchField"];
}

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

No branches or pull requests

1 participant