popTemplate(animated:completion:)
Removes the top-most template from the navigation hierarchy.
Declaration
func popTemplate(animated: Bool, completion: ((Bool, (any Error)?) -> Void)? = nil)func popTemplate(animated: Bool) async throws -> BoolParameters
- animated:
If True, CarPlay animates the transition between templates.
- completion:
The closure CarPlay calls after it removes the template.
Discussion
CarPlay calls completion after it removes the top-most template from the navigation hierarchy. The Boolean parameter is true if CarPlay removes the template successfully; otherwise, it’s false and CarPlay provides an error that describes the failure.
CarPlay throws an exception if it can’t remove the template and you don’t provide a closure.