UNUserNotificationCenter.current().requestAuthorization([.alert, .sound, .badge]) { (granted, error) in  //... }

// 유저의 설정값을 가져옴
UNUserNotificationCenter.current().getNotificationSettings { (settings) in //... }

// 기존 API
// APNS와 통신해서 디바이스 토큰을 얻어오기 때문에 네트워크가 필수적으로 필요
// 이렇게 받은 정보는 서버로 올려야 된다 -> 푸시 페이로드에 저 디바이스 토큰이 필요하기 때문에
UIApplication.shared().registerForRemoteNotifications()

// 로컬용
let content = UNMutableNotificationContent()
content.title = "Introduction to Notifications"
content.subtitle = "Session 707"
content.body = "Woah! These new notifications look amazing! Don't you agree?"
content.badge = 1

//  리모트 용
{
	"aps" : {
		"alert" : {
			"title": "Introduction to Notifications",
			"subtitle": "Session 707",
			"body": "Woah! These new notifications look amazing! Don't you agree?"
		},
		"badge": 1
	}
}

// 시작 기준은 항상 현재
UNTimeIntervalNotificationTrigger(timeInterval: 120, repeats: false)

UNTimeIntervalNotificationTrigger(timeInterval: 3600, repeats: true)

let dateComponents = DateComponents()

UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false)

let region = CLRegion()
// Region 설정
UNLocationNotificationTrigger(region: region, repeats: false)
import UserNotification

UNUserNotificationCenter.current().requestAuthorization([.alert, .sound, .badge]) { granted. error in //... }

let content = UNMutableNotificationContent()
content.title = "..."
content.body = "..."

let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 5, repeats: false)

let requestIdentifier = "..."
let request = UNNotificationRequest(identifier: requestIdentifier,
	content: content,
	trigger: trigger)

UNUserNotificationCenter.current().add(request) { (error) in //... }
protocol UNUserNotificationCenterDelegate: NSObjectProtocol

// foreground일 때 처리
func userNotificationCenter(_ center: UNUserNotificationCenter,
					willPresent notificaiton: UNUserNotification,
					withCompletionHandler completionHandler: (UNNotificationPrensentationOptions) -> Void)