‘#selector’ refers to a method that is not exposed to Objective-C

In my case the function of the selector was private. Once I removed the private the error was gone. Same goes for fileprivate.

In Swift 4
You will need to add @objc to the function declaration. Until swift 4 this was implicitly inferred.

Leave a Comment