Skip to content

Instantly share code, notes, and snippets.

@AviTsadok
Created September 18, 2022 03:27
Show Gist options
  • Save AviTsadok/07dfc9ca78d4857417c44694d13ec384 to your computer and use it in GitHub Desktop.
Save AviTsadok/07dfc9ca78d4857417c44694d13ec384 to your computer and use it in GitHub Desktop.
NavigationAttributes.swift
import Foundation
import ActivityKit
public enum NavigationDirection: Codable {
case right
case left
case straight
var toString: String {
switch self {
case .right:
return ""
case .left:
return ""
case .straight:
return ""
}
}
}
struct NavigationAttributes: ActivityAttributes {
public typealias NavigationStatus = ContentState
public struct ContentState: Codable, Hashable {
var nextTurn: NavigationDirection
var eta: Date
}
var destination: String
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment