In the painstaking porting to Swift 3.0 I am getting this error I am not making a sense of it in code:
guard let userInfo = notification.userInfo as? [String: Any] else {return}
How do I fix the code to make it compilable?
See this thread.
Going from [AnyHashable : Any] to [String : NSObject] w/ b6?
You can write something like this:
guard let userInfo = notification.userInfo as NSDictionary? as? [String: Any] else {return}
But, `[String: Any]` is not something useful in Swift.
Why don't you just unwrap it and use `userInfo` of `[AnyHashable: Any]` directly in your code?
guard let userInfo = notification.userInfo else {return}
if let myData = userInfo["myData"] as? String {
//Do something with myData
//...
}