title: adding UISearchBar to UICollectionviewController embedded into NavigationController IOS6
body: <p>I would like to add a searchbar to a UICollectionViewController, that's embedded the following way:
  UItabbarController > UINavigationbarController > UICollectionViewController > SearchBar (!)
  In this view, the search bar would replace the NavigationBar.</p>
  
  <p>Under the same design, if I test the above with a UITableViewController, the searchbar shows up fine (both programmatically and via the Storyboard)</p>
  
  <p>Problem is I can't get to add the search bar over the UICollectionViewController when I use the StoryBoard framework; it just sits in the middle of the view, and I'm clueless as to how to move it to the top. Plus, it always appears below the UICollectionview, so it's not visible.</p>
  
  <p>So, taking the other route, programmatically:</p>
  
  <pre><code>-(void)viewWillAppear:(BOOL)animated{
  self.searchBarTop = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
  [self.searchBarTop setPlaceholder:@"Enter your command here"];
  self.searchDC = [[UISearchDisplayController alloc]initWithSearchBar:self.searchBarTop contentsController:self];
  self.searchBarTop.delegate = self;
  
  [[self navigationController] setNavigationBarHidden:NO animated:animated];
  [self.navigationController.navigationBar addSubview:self.searchBarTop];
  }
  </code></pre>
  
  <p>With this, the search bar shows up fine.  But unfortunately, when I type in some text, it disappears above the view  - presumably because the underlying navBar does so - (don't know why...)</p>
  
  <p>I'm not sure exactly why the searchbar is fine with a UITableViewController, and why it is such a pain for a UICollectionViewController.
  That said, anyone has a clue as to why the searchbar/navBar disappear, and how I can fix that ?</p>
  
  <p>Any solution is welcome..</p>
  
  <p>thanks !
  -A</p>