我UIUserNotificationType.none
在 ViewController.swift 上使用 Swift3 中的,我得到了这个错误: 'none' is available user[] to construction an empty option set ; 这是我的代码:
func updateUI() {
let currentSettings = UIApplication.shared.currentUserNotificationSettings
if currentSettings?.types != nil {
if currentSettings!.types == [UIUserNotificationType.badge, UIUserNotificationType.alert] {
textField.isHidden = false
button.isHidden = false
datePicker.isHidden = false
}
else if currentSettings!.types == UIUserNotificationType.badge {
textField.isHidden = true
}
else if currentSettings!.types == UIUserNotificationType.none {
textField.isHidden = true
button.isHidden = true
datePicker.isHidden = true
}
}
}