소스 검색

Show actual time

Jonas Björkert 1 년 전
부모
커밋
d7c970899e
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      LoopFollow/Snoozer/SnoozerView.swift

+ 5 - 2
LoopFollow/Snoozer/SnoozerView.swift

@@ -86,13 +86,16 @@ struct SnoozerView: View {
         VStack(spacing: 0) {
         VStack(spacing: 0) {
             Spacer()
             Spacer()
 
 
-            // Clock and (optional) alert
             VStack(spacing: 8) {
             VStack(spacing: 8) {
-                Text("19:59" /* replace with time.value */)
+                TimelineView(.periodic(from: .now, by: 1)) { context in
+                    Text(context.date, format:
+                        Date.FormatStyle(date: .omitted, time: .shortened)
+                    )
                     .font(.system(size: 70))
                     .font(.system(size: 70))
                     .minimumScaleFactor(0.5)
                     .minimumScaleFactor(0.5)
                     .foregroundColor(.white)
                     .foregroundColor(.white)
                     .frame(height: 78)
                     .frame(height: 78)
+                }
 
 
                 /*
                 /*
                 if let alarm = alarmText.value, !alarm.isEmpty {
                 if let alarm = alarmText.value, !alarm.isEmpty {