This is the code given to me in Swift:
if application.respondsToSelector("registerUserNotificationSettings:") {
let userNotificationTypes = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound
let settings = UIUserNotificationSettings(forTypes: userNotificationTypes, categories: nil)
application.registerUserNotificationSettings(settings)
application.registerForRemoteNotifications()
} else {
let types = UIRemoteNotificationType.Badge | UIRemoteNotificationType.Alert | UIRemoteNotificationType.Sound
application.registerForRemoteNotificationTypes(types)
}
I receive an error at line two telling me:
| is not a prefix unary operator
What does that mean?
I also receive an error at line 7 telling:
Binary Operator | cannot be applied to UIRemoteNotificationType
Can someone help me get a better understanding on this? I'm clueless on what's going on.