UISearchController search bar not responding

I cannot get response events when I click on the UISearchController search bar in iOS 8.

I show a custom view with a dull background similar to the alert view when I click a button in the view, where the custom view has the UISearchController search bar as a subheading. Programmatically added searchController. When I try to touch the search bar, it does not respond in iOS 8, while I added the search bar with UISearchDisplayController for iOS 7, it works fine.

I have viewController A with a navigation bar. In viewController A, I have a button. When I click the button, I try to show the view as a custom view with a dull background similar to the widget view. So I added the following line in the button method.

class_name *view = [[class_name alloc] initWithNibName:@"xib_name" bundle:nil];
[self.navigationController.view addSubview:view];

The xib file with the class name has a dull background with subzones such as the SearchController search bar.

Instead

[self.navigationController.view addSubview:view];

added

[self presentViewController:view animated:YES completion:nil];

The UISearchController search bar now works, but I can’t get a transparent background view, a black background appears instead.

I need to display the contents of previous views and above that the current kinds of content, such as the kind of alerts.

I ask you, please, in objective-C.

+4
source share

All Articles