Preset

private struct Preset : Codable

A timer’s configured durations without its runtime countdown state.

  • id

    The stable identifier used to restore the original selection.

    Declaration

    Swift

    let id: UUID
  • The preset’s full duration in seconds.

    Declaration

    Swift

    let duration: Int
  • The seconds remaining at the warning threshold, or zero when disabled.

    Declaration

    Swift

    let warning: Int
  • The seconds remaining at the final threshold, or zero when disabled.

    Declaration

    Swift

    let final: Int
  • Copies the configured durations from the live timer.

    Declaration

    Swift

    init(_ timer: Timer)
  • Whether the durations fit in one day and the enabled phase thresholds descend toward zero.

    Declaration

    Swift

    var isValid: Bool { get }
  • Builds the app’s persisted timer record with a stopped countdown.

    See more

    Declaration

    Swift

    func persistentValues(selected: Bool) -> [String : any Hashable]

    Parameters

    selected

    Whether to restore this preset as the selected timer.