I'm using Xcode 8 beta 5 and I'm trying to setup an enum of notifications like this
enum Notes: String {
case note1
case note2
}
Then trying to use them as the notification names
NotificationCenter.default.post(name: Notes.note1.rawValue as NSNotification.Name,
object: nil, userInfo: userInfo)
But I'm getting an error.
Cannot convert value of type 'String' to specified type 'NSNotification.Name'
Is there a work around, or am I missing something? It works in Xcode 7.3.1
Any help would be appreciated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With