Skip to content

Instantly share code, notes, and snippets.

@AviTsadok
Last active September 19, 2022 11:47
Show Gist options
  • Save AviTsadok/ef380e7b9866d83fa0fc85e773919b3b to your computer and use it in GitHub Desktop.
Save AviTsadok/ef380e7b9866d83fa0fc85e773919b3b to your computer and use it in GitHub Desktop.
startNavigation.swift
func startNavigation() {
let attr = NavigationAttributes(destination: "New York")
let initialState = NavigationAttributes.NavigationStatus(nextTurn: .left, eta: Date())
do {
self.activity = try Activity<NavigationAttributes>.request(attributes: attr, contentState: initialState)
} catch let error {
print(error.localizedDescription)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment