hackiftekhar / IQKeyboardManager

Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more.
MIT License
16.45k stars 2.41k forks source link

The seacrhBar problem on the navigationItem #937

Closed RomanticEncounter closed 6 years ago

RomanticEncounter commented 7 years ago

UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 30)]; UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:titleView.bounds]; searchBar.placeholder = @"Test"; [titleView addSubview:searchBar]; self.navigationItem.titleView = titleView;

I'll crash in IQKeyboardManager.m 1876 line , What do I need to do? Before that, need to set it to NO? [[IQKeyboardManager sharedManager] setEnable:NO];

hackiftekhar commented 7 years ago

Can you please check with v4.0.13 now if this fix the issue? If it still doesn't fix the issue then probably you should disabled the library with the code you provided.

RomanticEncounter commented 7 years ago

Thank you, v4.0.13 did fix the issue.

whisper-bye commented 7 years ago

It has been fixed, but not work any more

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    IQKeyboardManager.sharedManager().enable = true

    return true
}
masuhara commented 5 years ago

Why this closed??