swiftwatchos-4

remove top left back button


I would like to remove the top left back button.

I tried to check "Full screen" option, but the arrow is still here.

I want to remove the back button because I have a button next to this button, and I don't want the user tap on it by mistake

Thx

enter image description here


Solution

  • According to the Apple Documentation the deprecated method that was in the previous answer (which used to solve this issue) has been replaced with:

    reloadRootPageControllers(withNames names: [String], 
                                contexts: [Any]?, 
                             orientation: WKPageOrientation, 
                               pageIndex: Int)
    

    "Parameters

    names

    An array of NSString objects, each of which contains the identifier of an interface controller in your storyboard file. The order of the identifiers in the array defines the order of the corresponding interface controllers in the page-based interface.

    contexts

    An array of objects of type id. Use this parameter to pass context objects to each of the interface controllers loaded into the page-based interface. The first object in the array is passed to the first interface controller, the second object is passed to the second interface controller, and so on.

    orientation

    The scrolling orientation for the page-based interface. For a list of valid values, see WKPageOrientation."

    And pageIndex should be pretty simple to figure out. If you only have one element in [names] it will be 0. Otherwise you should select the index of the page you want loaded from [names]