as NSError has become Error in Swift 3.0 how do you deal with error codes? For example:
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
        if error.code == 3010 {
            print("Push notifications are not supported in the iOS Simulator.")
        } else {
            print("application:didFailToRegisterForRemoteNotificationsWithError: %@", error)
        }
    }
Gives the message Value of type Error has no member code. Should I cast it to NSError?