Xcode 7 GM

Hello! In xcode 6, this line works just fine, but in xcode 7 GM, I am getting the error: Type of expression is ambigious without more context. And the part that is highligted for the error is the ".Alert"


Can someone help me, please?



application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: NSSet(array: [todoCategory]) as Set<NSObject>))

Replies

Put a better title for your post, write more context other than the line showing error, and check the latest reference.

+ settingsForTypes:categories:

You need to pass `Set<UIUserNotificationCategory>?` to categories parameter, not `Set<NSObject>`.

Try this:

application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: [todoCategory]))

This should compile, if `todoCategory` is declared as I guess.


(About pointing at `.Alert`, you can file a Bug Report.)