如果这么:let setting = UIUserNotificationSettings(forTypes: .Alert|.Badge|.Sound, categories: nil )
会提示错误 :Binary operator '|' cannot be applied to two UIUserNotificationType operands
解决办法:
let setting = UIUserNotificationSettings(forTypes: [.Alert,.Badge,.Sound], categories: nil)