2

In my AppDelegate, I have a method

application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool

However, I get the following warning: enter image description here

The original code from that method came from an Apple sample, then I did other attempts by copy/pasting the method definition from the protocol file, also, using AppCode, I just did an override/implement.

Everytime, XCode ends up telling me it's nearly a match.

I created a brand new project, added that method to the AppDelegate, no problem. I then take the entire content of the AppDelegate, paste it into my other project, and there, AppCode tells me again it's nearly a match.

Has anyone ever met that? Any suggestion on how to convince XCode/the compiler that this is really the method it says it is?

user1532080
  • 243
  • 2
  • 11

1 Answers1

1

This seem to be linked to an Apple bug, discussed here: Xcode 8 Warning "Instance method nearly matches optional requirement"

Doing what's advised in that question solved the underlying issue of the method not being called... Add this:

@objc(application:continueUserActivity:restorationHandler:)
user1532080
  • 243
  • 2
  • 11