CaliCastle / PopMenu

A fully customizable popup style menu for iOS 😎
https://popmenu.cali.so
MIT License
1.63k stars 187 forks source link

Objective-C Compatible? #30

Open mobileonekh opened 5 years ago

mobileonekh commented 5 years ago

Hi, Does this control compatible with Objective-C?

Thanks;

CaliCastle commented 5 years ago

Hi, as far as I know this is compatible with Objective-C, let me know if it doesn't, thanks!

kmyhy commented 5 years ago

No, this control didn't support Objective-C project. The swift-oc-bridge file which is auto-generated by Xcode didn't expose any available method.

dezinezync commented 5 years ago

The bridge file generated by Xcode has the following:

/// The object responsible for managing a pop menu <code>PopMenuViewController</code>
SWIFT_CLASS("_TtC7PopMenu14PopMenuManager")
@interface PopMenuManager : NSObject
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_DEPRECATED_MSG("-init is unavailable");
@end

As noted by @kmyhy, the methods are not exposed.

dezinezync commented 5 years ago

I was able to do some testing on the matter, and unfortunately, given how things are configured PopMenu won't be Obj-C compatible without some critical refactoring.

PopMenu uses Swift structs in quite a few places which isn't accessible/visible to Obj-C projects. I'm hoping to make some time and go through this more thoroughly to see if something else is feasible.