Skip to content

Commit

Permalink
[feat] 노티 알림 커스텀
Browse files Browse the repository at this point in the history
  • Loading branch information
hye0njuoo committed Jan 20, 2024
1 parent 6c56ba7 commit 07d3f96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ struct DynamicislandWidgetLiveActivity: Widget {
ActivityConfiguration(for: DynamicislandWidgetAttributes.self) { context in
// Lock screen/banner UI goes here
VStack {
Text("\(context.state.time)")
Text("다음초콜릿까지 남은시간:\(context.state.time) 🤤")
ProgressView("", value: (context.attributes.totalTime - (Double(context.state.intTime))) / context.attributes.totalTime)
}
.padding()
//.activityBackgroundTint(Color.gray)
//.activitySystemActionForegroundColor(Color.black)

Expand All @@ -40,10 +42,6 @@ struct DynamicislandWidgetLiveActivity: Widget {
DynamicIslandExpandedRegion(.center) {
VStack{
HStack{
Image("m&m0")
.resizable()
.scaledToFit()
.frame(width: 20,height: 20)
Text("남은시간😋:\(context.state.time)")
}
HStack{
Expand Down
5 changes: 3 additions & 2 deletions Sweety/Sweety/Home/lockHome.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Combine

struct LockHome: View {
@Binding var homeViewActive: Bool
@State private var remainingTime: TimeInterval = 1 * 1 * 60 //24*60*60으로 하면 24시간
@State private var remainingTime: TimeInterval = 1 * 1 * 10 //24*60*60으로 하면 24시간
@State private var timerStarted = false
let timerInterval: TimeInterval = 1.0
var activity: Activity<DynamicislandWidgetAttributes>?
Expand Down Expand Up @@ -95,7 +95,8 @@ struct LockHome: View {
func Notify(){

let content = UNMutableNotificationContent()
content.title = "시간끝"
content.title = "새로운 초콜릿이 도착했어요!"
//Text("힘들때 Sweety를 초콜릿 처럼 꺼내먹어요")

let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)

Expand Down

0 comments on commit 07d3f96

Please sign in to comment.