0
votes

I am trying to seque from a view controller to a uisearchbar that has focus or is animated.

The uisearchbar and uisearchdisplay is part of a uitableviewcontroller.

Example:

  • ViewController A has a search button that will segue to ViewController B.
  • ViewController B is a TableViewController with a SearchBar and Search Display Controller.
  • When the segue is preformed want the Search Display Controller to be animated on View Controller B

Let me know if anyone needs more details.

1

1 Answers

0
votes

Solved my own problem.

In View Controller B, I added the following property:

@property (assign, nonatomic) BOOL animateSearchBar;

Then in the prepareForSegue method in View Controller A, I added:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender  
{
    if([segue.identifier isEqualToString:@"MainSearchButton"])
    {
        ResponseTableViewController *nextController = (ResponseTableViewController *)segue.destinationViewController;
        nextController.animateSearchBar = YES;
    }
}

Then in the viewDidLoad method in View Controller B, I added:

if (self.animateSearchBar)
{
    [self.searchDisplayController setActive: YES animated: YES];
}