I'm trying to implement the HopperPlugin Objective-C protocol from the Hopper SDK in a Swift class.
The compiler fails with an "Type 'MyPlugin' cannot conform to protocol 'HopperPlugin' because it has requirements that cannot be satisfied"
error.
I imported all the SDK types in the bridging header. I used XCode's "Refactor/Generate Missing Function Definitions" to generate all the stubs but one is missing because the Hopper API makes use of a pointer to an incomplete type for HopperUUID as follows:
@class HopperUUID;
…
@protocol HopperPlugin <NSObject>
…
- (HopperUUID *)pluginUUID;
I'm guessing here, but it seems like this is why I am failing to meet the HopperPlugin protocol requirements. I don't create an instance of this type myself - I'm meant to call HopperUUID! HPHopperServices.uuid(String!)
to get one but this method is also not defined (XCode auto-completion shows all the other HPHopperServices functions but not this one). Apple's docos suggest it might get mapped to an OpaquePointer
but no function is generated with that signature either.
How do I diagnose what's going wrong? I've made use of the XCode's refactor and auto-completion to implement and identify the functions Swift knows about. Those relating to the incomplete HopperUUID type are not defined. Is there a more verbose compiler output that is being hidden from me?
What do I need to do to successfully implement this protocol in Swift?