Untitled

mail@pastecode.io avatar
unknown
swift
2 years ago
1.1 kB
4
Indexable
Never
Button {
                            let content = UNMutableNotificationContent()
                            content.title = TextConstants.notificationTitle
                            content.subtitle = TextConstants.notificationSubtitle
                            // Notification içeriği henüz belli olmadığından bunu yazdırdım.
                            content.sound = UNNotificationSound.default
                            let trigger = UNTimeIntervalNotificationTrigger(timeInterval: Double(selectedTimeDuration)!*60, repeats: true)
                            let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: trigger)
                            UNUserNotificationCenter.current().add(request)
                            self.mode.wrappedValue.dismiss()
                        } label: {
                            buttonContent(buttonTitle: TextConstants.confirmButtonTitle)
                                .modifier(TextModifier(font: Font.custom("Poppins-Regular", size: 16).weight(.regular), foregroundColor: .black))
                        }