如果这么: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)
原文链接:https://www.f2er.com/swift/325608.html