I'm building an alarm kinda app and I just want to display a pop up message (alert message) when user enter time below 2 hours, the user should get a message by saying like, "please enter time more than 2 hours of duration".
This is where I stored the alarm value
myViewModel.myModel.waketime
and I want to display the message when a user click this below image
Image(systemName: "checkmark.circle")
.resizable()
.aspectRatio(contentMode: .fit)
.clipShape(Circle())
.sheet(isPresented: $showPlayer) {
SecondView()
}
This is another view where the user picks the alarm time
Text("Alarm : ")
.font(.body)
Spacer()
DatePicker("", selection: self.$myViewModel.myModel.waketime, displayedComponents: .hourAndMinute)
Please help me to solve this!!