user855698
user855698

Reputation:

How to show keyboard without touching the UISearchbar?

Can I show the keyboard for UISearchbar on viewWillAppear method call without touching the UISearchbar ?

Upvotes: 12

Views: 4012

Answers (2)

Jain_Taresh
Jain_Taresh

Reputation: 99

Working Solution:-

Don't use [self.searchController setActive:YES] before becomeFirstResponder.

- (void)viewDidAppear:(BOOL)animated {
         [super viewDidAppear:animated];
         dispatch_async(dispatch_get_global_queue(0, 0), ^{
         dispatch_async(dispatch_get_main_queue(), ^{
       //[self.searchController setActive:YES];
         [self.searchController.searchBar becomeFirstResponder];
       });
   });
}

Upvotes: 1

0x8badf00d
0x8badf00d

Reputation: 6391

[mySearchBar becomeFirstResponder];

Upvotes: 22

Related Questions