How do you use the delegate? When I implement the delegate , I get an error in my AppName-Swift.h file.
I have a Swift class that I've implemented to be the delegate for ImagePlaygroundViewController. Unless there's a way to access it directly from Objective-C. I figured I'd use an intermediate Swift class and then just pass the selected image to my Objective-C view controller.
This is an AppKit app. Mostly in Objective-C, but with sprinkles of Swift and SwiftUI here and there.
I've implemented the delegate and all the required methods.
@objc public class TFImagePlaygroundManager: NSObject, ImagePlaygroundViewController.Delegate
This error is what I get:
Cannot find protocol declaration for 'ImageGenerationViewControllerDelegate'; did you mean [some other delegate]
Is it not posible to use Image Playground in a mixed Swift / Objective-C Mac AppKit app?
This is the code that's auto-generated inside my AppName-Swift.h file:
@interface TFImagePlaygroundManager : NSObject <ImageGenerationViewControllerDelegate>
- (void)imagePlaygroundViewController:(ImagePlaygroundViewController * _Nonnull)imagePlaygroundViewController didCreateImageAt:(NSURL * _Nonnull)imageURL;
- (void)imagePlaygroundViewControllerDidCancel:(ImagePlaygroundViewController * _Nonnull)imagePlaygroundViewController;
- (nonnull instancetype)initWithDelegate:(id <TFImagePlaygroundDelegate> _Nonnull)delegate OBJC_DESIGNATED_INITIALIZER;
- (void)showImagePlaygroundFromController:(NSViewController * _Nonnull)controller;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end