UISplitViewController, Primary view ViewDidLoad not called on iOS 13

I have problem with UISplitViewController, everything work on iOS version 11 & 12 (before iOS 13).
But in iOS 13, ViewDidLoad on Primary View ViewDidLoad not called, while I need this because when User make changes on secondary view, code will change Primary View.

Can you help me to find solution?

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    I test on iPhone simulator (iOS 13 )with the official sample : https://docs.microsoft.com/en-us/samples/xamarin/ios-samples/splitview/ , it works fine without your problem , the method ViewDidLoad called on both on SplitViewController and Primary View , could you test the sample first?

  • sandiharsenosandiharseno Member ✭✭

    ColeX, Thanks for your response.
    I forgot to say, that the childs view is UINavigationController.
    It is run correcly if I add UIViewController as Childs.

    PrimaryView _primaryView = new PrimaryView(); SecondaryView _secondaryView = new SecondaryView(); ViewControllers = new UIViewController[] {_primaryView, _secondaryView};

    Code above is run correcly.

    But right now I use UINavigationController as Childs. This is snippet of my code:

    PrimaryView _primaryView = new PrimaryView(); UINavigationController _primaryNav = new UINavigationController(_primaryView); SecondaryView _secondaryView = new SecondaryView(); UINavigationController _secondaryNav = new UINavigationController(_secondaryView); ViewControllers = new UIViewController[] {_primaryNav, _secondaryNav};

    That code not call the ViewDidLoad on PrimaryView.

  • ColeXColeX Member, Xamarin Team Xamurai

    It works fine with the Navigation as child view ,check my sample .

  • sandiharsenosandiharseno Member ✭✭
    edited October 15

    @ColeX , I already test you sample, it not call the ViewDidLoad (MasterTableView's ViewDidLoad).

    Do you run it on landscape mode or portait mode?

  • ColeXColeX Member, Xamarin Team Xamurai

    iPhone simulator on portait mode.

  • sandiharsenosandiharseno Member ✭✭
    edited October 16

    @ColeX, I run it with iPad simulator in portait mode, it did not call ViewDidLoad. But when I run on landscape mode everything run.

  • ColeXColeX Member, Xamarin Team Xamurai

    The PrimaryView (table viewController) is always presented in landscape , so the ViewDidLoad would be called at first.

    In portait mode PrimaryView is hidden at first ,ViewDidLoad would be triggered when you right swipe to show the table , maybe apple changes the initial time of PrimaryView on iOS13.

Sign In or Register to comment.