mirror of
https://github.com/home-assistant/iOS.git
synced 2026-06-16 04:16:39 -05:00
<!-- Thank you for submitting a Pull Request and helping to improve Home Assistant. Please complete the following sections to help the processing and review of your changes. Please do not delete anything from this template. --> ## Summary <!-- Provide a brief summary of the changes you have made and most importantly what they aim to achieve --> ## Screenshots <!-- If this is a user-facing change not in the frontend, please include screenshots in light and dark mode. --> <img width="1206" height="2622" alt="Simulator Screenshot - Daily tester 2 - 2026-06-08 at 11 49 31" src="https://github.com/user-attachments/assets/f4e5e291-2377-46d5-8ac5-bc0c6279bba7" /> ## Link to pull request in Documentation repository <!-- Pull requests that add, change or remove functionality must have a corresponding pull request in the Companion App Documentation repository (https://github.com/home-assistant/companion.home-assistant). Please add the number of this pull request after the "#" --> Documentation: home-assistant/companion.home-assistant# ## Any other notes <!-- If there is any other information of note, like if this Pull Request is part of a bigger change, please include it here. -->
46 lines
1.3 KiB
Swift
46 lines
1.3 KiB
Swift
import Foundation
|
|
import Shared
|
|
|
|
/// Stable identifier for a TestFlight message used to track seen state.
|
|
/// Define message IDs as static constants on this type:
|
|
///
|
|
/// ```swift
|
|
/// extension TestFlightMessageId {
|
|
/// static let betaFeedbackRequest = TestFlightMessageId("beta-feedback-request-2026-06")
|
|
/// }
|
|
/// ```
|
|
struct TestFlightMessageId: RawRepresentable, Hashable {
|
|
let rawValue: String
|
|
init(_ rawValue: String) { self.rawValue = rawValue }
|
|
init(rawValue: String) { self.rawValue = rawValue }
|
|
}
|
|
|
|
struct TestFlightMessage: Identifiable, Equatable {
|
|
struct CallToAction: Equatable {
|
|
let title: String
|
|
let url: URL
|
|
}
|
|
|
|
let id: TestFlightMessageId
|
|
let title: String
|
|
let items: [WhatsNewItem]
|
|
let targetPlatforms: [WhatsNewTargetPlatform]
|
|
let callToAction: CallToAction?
|
|
|
|
init(
|
|
id: TestFlightMessageId,
|
|
title: String,
|
|
items: [WhatsNewItem],
|
|
targetPlatforms: [WhatsNewTargetPlatform] = [.iPhone, .iPad, .mac],
|
|
callToAction: CallToAction? = nil
|
|
) {
|
|
precondition(!items.isEmpty)
|
|
precondition(!targetPlatforms.isEmpty)
|
|
self.id = id
|
|
self.title = title
|
|
self.items = items
|
|
self.targetPlatforms = targetPlatforms
|
|
self.callToAction = callToAction
|
|
}
|
|
}
|