I was using the UIUserNotificationType.none
in Swift3 on ViewController.swift, and I got this error: 'none' is unavailable user[] to construct an empty option set ; Here is my code:
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
}
}
}
.none
with[]
to construct an empty option set? – ExpostulationUIUserNotificationType
. There isn't anynone
value. – Buehler