ios-sdk-examples icon indicating copy to clipboard operation
ios-sdk-examples copied to clipboard

Split view on iPad doesn’t load anything initially

Open friedbunny opened this issue 6 years ago • 1 comments

When launching the app on iPad, our UISplitViewController defaults to showing the child view controller (i.e., the map/example), but this view controller does not load anything until an example is tapped in the primary (menu table view) controller.

This means that UI tests aren’t able to start on iPad, because the elements it expects are not available.

We may need to fiddle with this property:

https://github.com/mapbox/ios-sdk-examples/blob/4dbe089786ef6b057954ffa72bec0b184b0c3ffb/Examples/ExamplesTableViewController.m#L47

Screenshots

Nothing loads initially

Screen Shot 2019-09-20 at 12 55 08 PM

Rotating the screen a few times brings up the primary controller

Screen Shot 2019-09-20 at 12 55 31 PM

/cc @captainbarbosa @julianrex @lloydsheng

friedbunny avatar Sep 20 '19 20:09 friedbunny

This seems to occur on iOS 13 on iPad where the viewDidLoad is too late (ref)... A workaround for me was to add:

-(void)awakeFromNib {
    [super awakeFromNib];
    // The menu and example view controllers are displayed side-by-side onscreen.
    self.splitViewController.preferredDisplayMode = UISplitViewControllerDisplayModeAllVisible;
}

tsuz avatar Apr 01 '20 11:04 tsuz