20 lines
703 B
Swift
20 lines
703 B
Swift
#if os(iOS)
|
||
import ActivityKit
|
||
import Foundation
|
||
|
||
/// Shared between the main app (to drive the activity lifecycle) and the
|
||
/// DownloadWidgetExtension (to render the Lock Screen / Dynamic Island UI).
|
||
/// Both targets must compile this exact definition — keep them in sync.
|
||
struct DownloadActivityAttributes: ActivityAttributes {
|
||
/// Item title set once at activity start; never changes during the download.
|
||
let itemTitle: String
|
||
|
||
struct ContentState: Codable, Hashable {
|
||
/// Overall fraction across all tracks (0.0 – 1.0).
|
||
var progress: Double
|
||
/// Total bytes written to disk so far, shown as "X MB downloaded".
|
||
var bytesDownloaded: Int64
|
||
}
|
||
}
|
||
#endif
|