Search code examples
rubymotion

How to open a "window" in a modal?


I am creating an iOS app with the help of Rubymotion. I am using a navigationController as a rootview and I need to open a window in a modal. How can I do that?


Solution

  • You'll need to open it on top of another UIViewController. So, push a UIViewController onto your UINavigationController and then use the presentModalViewController:animated: method:

    navigation_controller.pushViewController(main_view_controller, animated: true)
    main_view_controller.presentModalViewController(modal_controller, animated:true)
    

    When you're done with it, dismiss it:

    main_view_controller.dismissModalViewControllerAnimated(true)