Can't push view controller when i use UISearchController

I have UISearchcontroller

. When I select the desired item and trying to click viewcontroller

, viewcontroller

do not press. The reason for this question is set self.definespresentationcontext

to NO

. Its working if I set self.definespresentationcontext

to YES

but hidden search strings are hidden.

Example:

    self.searchResultController = [[MyResultsController alloc]init];
    self.searchResultController.delegate = self;
    self.searchController = [[UISearchController alloc] initWithSearchResultsController:self.searchResultController];
    self.searchController.delegate = self;
    self.searchController.hidesNavigationBarDuringPresentation = NO;
    self.searchController.searchBar.delegate = self;
    self.searchController.searchBar.showsCancelButton = YES;
    self.searchController.searchBar.translucent = YES;
    [self.searchController.searchBar sizeToFit];
    self.definesPresentationContext = NO;

      

Can anyone help me to solve this problem? Thanks in advance.

+3


source to share


2 answers


Make sure your UIViewController is set to render below the top bars and then everything should work as expected.

self.definesPresentationContext = YES



Interface builder

0


source


Can



presentingViewController?.navigationController?.pushViewController(eventDetailsViewController, animated: true)

      

0


source







All Articles