Resolved replace content of a popover

Discussion in 'iOS Programming' started by grandM, Jan 30, 2016.

  1. grandM macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #1
    So I have a popover with some content. Upon tapping a UIBarButtonItem I need the content of the popover to be replaced by the new ViewController. I tried applying show and show Detail but they are replacing the content of the view on which the popover is anchored?

    I just want the popover view to be replaced by the view of the next VC.
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    If you have a Navigation controller inside the popover you can just push a new view controller.
     
  3. grandM thread starter macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #3
    Is there another way? Because I tried to embed in navigationController and got a crash stating it no longer new the identifier. Actually everything was embedded in a navigationController by the split view Controller (between the masterVC and the detailVC). I'm performing a popover on a pushed VC on the detailVC. But there seems to be a bug. Sometimes I even had to add navigationItems myself. Xcode seems to have forgotten the NavigationController.
     
  4. grandM thread starter macrumors 6502a

    grandM

    Joined:
    Oct 14, 2013
    #4
    I found the solution! In prepareForSegue I just have to call for:
    Code:
    destinationVC.modalPresentationStyle = UIModalPresentationStyle.CurrentContext
    
    My sincere thanks for your help though.
     

Share This Page