Presenting New View Controller

Thread is closed for posting
5 posts, 0 answers
  1. Trevor
    Trevor avatar
    18 posts
    Member since:
    Feb 2017

    Posted 13 Mar Link to this post

    Hi,

    I successfully implemented SideDrawer and customized it to my liking. When I present a ViewController from my Home ViewController, which defined the SideDrawer, it replaces the current view with the drawer and everything, which is an expected behavior with PresentViewController. What is the proper protocol to preserve the SideDrawer throughout the app? Or presenting a view controller in such a way that this does not happen?

    Thanks

  2. Deyan
    Admin
    Deyan avatar
    2147 posts

    Posted 14 Mar Link to this post

    Hello,

    Thanks for writing. You are probably referring to using a UINavigationController with a SideDrawer?: 

    http://docs.telerik.com/devtools/ios/sidedrawer/sidedrawer-with-uinavigationcontroller


    Regards,
    Deyan
    Telerik by Progress
    Want to build beautiful Android apps as well? Check out UI for Android which enables the same set of scenarios, allowing you to create the same great app experience on both iOS and Android.
  3. Trevor
    Trevor avatar
    18 posts
    Member since:
    Feb 2017

    Posted 14 Mar in reply to Deyan Link to this post

    Hi,

    Thanks for the response, I saw that, but I am just trying to present a new view controller depending on which menu item was tapped, from the DidSelectItem. If I do PresentViewController, the view controller appears, but the menu is not retained anymore. How do I solve this and retain the menu in the new view?

  4. Deyan
    Admin
    Deyan avatar
    2147 posts

    Posted 16 Mar Link to this post

    Hi Trevor,

    Thanks for writing back.

    This should be the solution to your case. By using a root UINavigationController which defines a SideDrawer as described in the article I've shared. In this way you will define the Menu contents once and reuse them thanks to the fact that your root view controller defines a SideDrawer.

    Does this not help?

    Regards,
    Deyan
    Telerik by Progress
    Want to build beautiful Android apps as well? Check out UI for Android which enables the same set of scenarios, allowing you to create the same great app experience on both iOS and Android.
  5. Trevor
    Trevor avatar
    18 posts
    Member since:
    Feb 2017

    Posted 17 Mar in reply to Deyan Link to this post

    Hi,

    So the documentation you linked doesn't define a UINavigationController in it. So I assume I do something like:

    1.SideDrawerGettingStarted main = new SideDrawerGettingStarted ();
    2.UINavigationCongtoller navigationController = new UINavigationController(main);
    3.TKSideDrawerController sideDrawerController = new TKSideDrawerController (navigationController);
    4.this.Window.RootViewController = sideDrawerController;

     

    This keeps the side drawer throughout the app, but now my custom UINavigationBar with the menu button gets overridden by the UINavigationControllers, even the example in the page you linked me, the UINavigationBar defined is overridden. So I am still a bit confused. Thanks for all the help so far!

  6. Trevor
    Trevor avatar
    18 posts
    Member since:
    Feb 2017

    Posted 17 Mar in reply to Trevor Link to this post

    Figured out there is a method to hide the UINavigationControllers navigation bar:

    this.NavigationController.SetNavigationBarHidden(true, false);
Back to Top