func scheduleNotification(inSeconds: TimeInterval, completion: @escaping (_ Success: Bool) ->()) {
let notif = UNNotificationContent()
notif.title = NSString.localizedUserNotificationString(forKey: "New Notification", arguments: nil)
notif.subtitle = "These are great!"
notif.body = "The new notification options are awesome!"
let notifTrigger = UNTimeIntervalNotificationTrigger(timeInterval: inSeconds, repeats: false)
let request = UNNotificationRequest(identifier: "myNotification", content: notif, trigger: notifTrigger)
UNUserNotificationCenter.current().add(request, withCompletionHandler: {error in
if error != nil {
print(error)
completion(false)
} else {
completion(true)
}
})
}
Udemy 비디오를 따라하고 있으며 로컬 알림의 제목, 부제목 및 본문을 설정하는 데 문제가 있습니다. 세 개의 할당 라인 모두에 대해 동일한 오류가 발생합니다.로컬 알림의 제목, 부제목 및 본문 선언하기
속성에 할당 할 수 없습니다. 'xxx'는 get 전용 속성입니다.