krz/moonrise

Night-sky companion for iPhone, Apple Watch and Vision Pro: what's up tonight, the Moon, planets, launches and missions, and a Library of the solar system. SwiftUI app with a Cloudflare Workers backend. astronomy cloudflare-workers ios night-sky space swiftui visionos watchos

App/Shared/PassActivity.swift

17 lines · 501 bytes

 1import ActivityKit
 2import Foundation
 3
 4/// Live Activity for a satellite pass. Computed on the device and never updated: the view runs on timers
 5/// and goes stale after set. Shared by the app and the widget extension.
 6struct PassActivityAttributes: ActivityAttributes {
 7    struct ContentState: Codable, Hashable {}
 8
 9    var name: String
10    var rise: Date
11    var peak: Date
12    var set: Date
13    var riseAzimuth: Double
14    var setAzimuth: Double
15    var maxAltitude: Double
16    var visible: Bool
17}