Swift 2 changed many of the types commonly used this way to implement the OptionSetType protocol instead. Consequently they support a syntax resembling arrays, so your particular example can be written like this.
let notificationOptions = UIUserNotificationSettings(forTypes: [.Alert, .Badge], categories: nil)
UIApplication.sharedApplication().registerUserNotificationSettings(notificationOptions)
Relatedly, checking whether an option belongs to an option set no longer requires a bitwise AND followed by testing for nil. Instead, ask whether that set contains the particular value, much as you would check an array for an element.
let notificationOptions = UIUserNotificationSettings(forTypes: [.Alert, .Badge], categories: nil)
if notificationOptions.types.contains(.Alert) {
// handle this option
}
For Swift 3, write those examples this way:
let notificationOptions = UIUserNotificationSettings(types: [.alert, .badge], categories: nil)
UIApplication.shared.registerUserNotificationSettings(notificationOptions)
and
let notificationOptions = UIUserNotificationSettings(types: [.alert, .badge], categories: nil)
if notificationOptions.types.contains(.alert) {
// handle this option
}