2

I have to implement the following layout:

Header

For this, I have the following constraints:

  • UINavigation bar should be the system's because every other imitation looks ugly
  • UISegmentedControl should be placed inside the navigation bar
  • the segmented control should be placed below the navigation buttons
  • I have to use UISearchDisplayController to have the system default search look & feel
  • For the UISearchDisplayController to work I have to have UITableViewController, because it does not work with a simple UIViewController

I have found several solutions for something similar (like this question), but they either use UIToolbar/UIView (which I can't add to my controller, because all UITableViewController has is a scroll view), or hacking system navigation bar (in which either the buttons are aligned to the bottom, or it uses private iOS frameworks which is a forbidden fruit, we know it). I also tried to add the segmented control to the tableHeaderView, but it is consumed by the search bar.

Is this even possible to do?

Community
  • 1
  • 1
gklka
  • 2,459
  • 1
  • 26
  • 53
  • It is possible to do this. Apple does this in App Store. Also looking to find out how. – Lasse Bunk Jul 05 '16 at 15:14
  • 1
    Apple does this with a nasty hack in the App Store. Just see how it behaves when you do the back swipe gesture slowly. – gklka Jul 05 '16 at 15:23

0 Answers0