how to show second screen of the array when presentController(withNames:contexts:) is executed

129 Views Asked by At
presentController(withNames:["ScreenOne", "ScreenTwo", "ScreenThree"], contexts:nil)

when the above line is executed, the ScreenOne screen shows up as below:

first page in the array is highlighted

how would I go about getting the second page to show up when the above line is executed. i.e. ScreenTwo

I want second page to show up in the array like this

1

There are 1 best solutions below

0
On

If you want to display another page, you'll need to insert, in the awake method of the chosen controller a call to becomeCurrentPage().

override func awake(withContext context: Any?) {
    super.awake(withContext: context)

    // Do your stuff with the context and determine if it is the controller to display

    if mustBeDisplayed {
        becomeCurrentPage()
    }
}