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/EclipseActivity.swift

19 lines · 623 bytes

 1import ActivityKit
 2import Foundation
 3
 4/// Live Activity for eclipse contacts at one site. Everything is fixed at the start and drawn with
 5/// timer text, so it counts down correctly without updates. Shared by the app and the widget extension.
 6struct EclipseActivityAttributes: ActivityAttributes {
 7    struct ContentState: Codable, Hashable {}
 8
 9    /// "Total", "Annular" or "Partial".
10    var kind: String
11    var site: String
12    var c1: Date
13    var c2: Date?
14    var peak: Date
15    var c3: Date?
16    var c4: Date
17    /// Time zone identifier at the site; clock times are in UTC without one.
18    var timeZone: String?
19}