Contents

popToRootTemplate(animated:completion:)

Removes all of the templates from the navigation hierarchy except the root template.

Declaration

func popToRootTemplate(animated: Bool, completion: ((Bool, (any Error)?) -> Void)? = nil)
func popToRootTemplate(animated: Bool) async throws -> Bool

Parameters

  • animated:

    If True, CarPlay animates the transition between templates.

  • completion:

    The closure CarPlay calls after it removes the required templates.

Discussion

CarPlay calls completion after it removes all of the required templates. The Boolean parameter is true if CarPlay removes all of the templates successfully; otherwise, it’s false and CarPlay provides an error that describes the failure.

CarPlay throws an exception if it can’t remove the templates and you don’t provide a closure.

See Also

Adding and Removing Templates