Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/#19 #21

Merged
merged 2 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[feat] 노티 알림 커스텀
  • Loading branch information
hye0njuoo committed Jan 20, 2024
commit 07d3f9667a5937cd3c2512c6e409a5cd0af68bb4
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