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

Not working with UISearchBar #1064

Closed Davarg closed 6 years ago

Davarg commented 7 years ago
#import "ViewController.h"

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(
                                                                           0
                                                                           , 0
                                                                           , 210
                                                                           , 30
                                                                           )];

    self.navigationItem.titleView = searchBar;
}

@end

Terminating app due to uncaught exception 'NSRangeException', reason: ' -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'

hackiftekhar commented 6 years ago

This no longer reproduce a crash with latest master version. Looks like latest changes fix this issue already.