ํฐ์คํ ๋ฆฌ ๋ทฐ
import UserNotifications
func goPushAlarm(){
let content = UNMutableNotificationContent()
content.title = "๐โจ๊ฐ์ ๋
น์ํ ์๊ฐ์ด์์๐โจ"
content.subtitle = "์ง๊ธ์ ๋ฏธ์ ๋ถํ ์์
์ ๋
น์ํ ์๊ฐ์
๋๋ค! ์ํ๊ธฐ๊ฐ์ ์ํด์ ๋ฏธ๋ฆฌ ๋
น์ํด์ฃผ์ธ์๐"
content.body = "11:00 AM ~ 1:00 PM ๋ฏธ์ ๋ถํ"
var date = DateComponents()
date.hour = 00
date.minute = 40
let trigger = UNCalendarNotificationTrigger(dateMatching: date, repeats: true)
let request = UNNotificationRequest(identifier: "timerdone", content: content, trigger: trigger)
UNUserNotificationCenter.current().add(request, withCompletionHandler: nil)
}
์ด๋ฐ์์ผ๋ก ์ง๋ฉด ๋๋ค :)