mycode/myApp/Keging/Shared/KegingActivityAttributes.swift
songyc macbook 32737d74fd feat(keging): Live Activity 자가 렌더링 재설계 — 앱이 정지해도 움직이는 DI/잠금화면 (실기기 4차 피드백)
- ActivityKit엔 미래 상태 예약 API가 없음을 확인(푸시 서버 없이는 국면 갱신이 앱
  런타임 의존) → 상태에 세트 전체 일정을 실어 시스템 렌더 요소로 심장을 재구성:
  국면 색 타임라인 바(하드 스톱 그라데이션) + 실시간 플레이헤드
  ProgressView(timerInterval:) + 전체 남은 시간. 플레이헤드가 걸친 색 = 지금 국면
- 국면 라벨·횟수는 앱 갱신 유지(syncCurrent 단일 진입점), stale 시 흐림
- 오디오 키퍼: 완전 무음 대신 ±2 LSB 디더 노이즈(무음 감지 정지 회피) +
  백그라운드 전환 ~30초 브리지 태스크
- 통계 타임라인 점별 시각 라벨 제거(겹침 — 시각은 오늘 기록 목록에서)
- 도움말·번역 갱신, CLAUDE.md 현행화. 시뮬: DI 백그라운드 80초+(10/20) 진행 확인

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UPmp29DQHY6Ahfss5SRopT
2026-09-02 16:26:29 +09:00

40 lines
1.4 KiB
Swift
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// KegingActivityAttributes.swift
// Keging
//
// Live Activity( ) · .
//
// ( 4 ): ActivityKit " " API
// . (sessionStart·
// ///) , · ·
// timerInterval ( ) .
//
#if canImport(ActivityKit)
import ActivityKit
import Foundation
nonisolated struct KegingActivityAttributes: ActivityAttributes {
nonisolated struct ContentState: Codable, Hashable {
var phase: KegelPhase
var rep: Int
var totalReps: Int
var phaseStart: Date
var phaseEnd: Date
//
var sessionStart: Date
var prepSeconds: Int
var contractSeconds: Int
var relaxSeconds: Int
var sessionEnd: Date {
sessionStart.addingTimeInterval(
Double(prepSeconds + totalReps * (contractSeconds + relaxSeconds))
)
}
}
var startedAt: Date = Date()
}
#endif