open-remora

Open Remora, a free secondary dive computer for Apple Watch Ultra
git clone https://git.schurger.org/open-remora.git
Log | Files | Refs | README | LICENSE

NoFlyActivity.swift (815B)


      1 // SPDX-License-Identifier: GPL-2.0-only
      2 import Foundation
      3 #if canImport(ActivityKit) && os(iOS)
      4 import ActivityKit
      5 
      6 /// "No-fly time" Live Activity: on the lock screen and in the Dynamic Island of the iPhone, with a countdown
      7 /// to the time when flying becomes possible again.
      8 /// iOS limit: a Live Activity stays active for 8 h, then up to 4 h on the lock screen; a notification
      9 /// announces the end of the no-fly time in every case.
     10 struct NoFlyAttributes: ActivityAttributes {
     11     struct ContentState: Codable, Hashable {
     12         /// Time from which flying becomes possible again.
     13         var until: Date
     14         /// Time from which going up to 2000 m is possible (nil: already possible).
     15         var altitudeUntil: Date?
     16     }
     17 
     18     var diveNumber: Int
     19     var maxDepth: Double
     20     var diveEnd: Date
     21 }
     22 #endif