0

I'm building an iPhone app (using xcode 6.2 and Swift)

I need my app to have:

  • Custom Header (I've tried using UINavigationBar but it doesn't seem to fit my needs - though there is a good change that I'm not doing it right)

  • Sliding Menu slides from the left while moving everything to the right (including the header)

  • Pages shown below the header, and has transitions inside the container which sits below the header

like that:

enter image description here

I've managed to do it, but, when I'm replacing page inside the pages wrapper (using presentViewController for example - it replaces the whole view and not only the page

My current structure is :

enter image description here

  • background stays fixed.
  • PagesContainer hold both top bar and the PagesHolder
  • MenuViewController is added dynamically to the PagesContainer with a negative offset
  • pages should be drawn and transition inside PagesHolder

What is your suggestion for the best structure for doing that? please, mainly focus on how can I manage pages transitions inside a view that is part of UIViewController (like the PagesHolder in my structure)

Yaron U.
  • 7,681
  • 3
  • 31
  • 45
  • Not an answer but a suggestion, "Hamburger" menus are discouraged by Apple app designs as they remove the sense of flow of your app. I would recommend you to look "Designing Intuitive User Experiences" from the WWDC2014 – Benjamin Jimenez Apr 06 '15 at 12:39
  • @BenjaminJimenez thanks for the suggestion. I read it and I think that using it in my specific app still makes sense. also, this is a bit too late for this app, but I'll definitely consider that for the next times :) – Yaron U. Apr 06 '15 at 12:56
  • I would suggest using a UINavigationController as your initial controller with a UIViewController as its root. Then inside that just have your pages controller. The navigation bar will come for free with the Nav controller and you can set the left button to be your menu icon which activates the side menu. Any work inside the controller should happen below the nav bar now. – Rory McKinnel Apr 06 '15 at 13:50
  • @RoryMcKinnel but, is it possible to completely redesign the navigation bar inside the `UINavigationController`? for example to make it half transparent and overlay the pages? – Yaron U. Apr 06 '15 at 13:53
  • You can certainly make the nav bar transparent and give it an alpha value: http://stackoverflow.com/questions/6781466/change-color-of-translucent-black-uinavigationbar. Any background you put in the controller will then show through (Use constraints for the background top to be the top of the controller and not the top layout guide). Not sure I fully understand what you mean by overlay pages. I assume that would be down to the controller at the top of the navigation stack. For this you want its top constraint to be the top layout guide so everything happens underneath the nav bar. – Rory McKinnel Apr 06 '15 at 14:05

0 Answers0