Pragma ignore missing protocol definition

Dear Apple,


Is there a clang diagnostic ignore for the warning "Cannot find protocol definition for <...>"?


While I cannot make the definition available in the header, every file importing this header will also import the definition. In which case, the code will run correctly (right?)

This also happens when having a Swift protocol and using it in Objective-C.


More information can be found on StackOverflow. But the warning shows up and it'd be great if there was a way to ignore it.

It's been a year and this is still the thing. I'm also pretty disappointed that there isn't even a way to ignore those warnings if we can't do anything about them.

Warnings for missing protocol definitions or incomplete conformance can be suppressed for a single line with

// To get rid of 'Class does not conform to protocol' warnings
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wprotocol" 
@interface YourClass: NSObject<YourProtocol>
#pragma clang diagnostic pop
// To get rid of 'cannot find protocol definition for' warnings
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wprotocol" 
@property id<YourProtocol> yourProperty
#pragma clang diagnostic pop

We're in the process of converting our SDK to Swift and now that we have some Swift protocols we're seeing this "Cannot find protocol definition for xxx" issue.

The code builds and runs fine, everything works as expected, but we see these warnings in the Objective-C classes that conform to the Swift protocols.

Unfortunately the methods for suppressing the warnings mentioned above aren't working for us.

Frustrating that this has been an ongoing issue for over two years without resolution.

Pragma ignore missing protocol definition
 
 
Q