I want to conditionally add a delegate for only iOS (not VisionOS) This is where I assign a ViewController that is a delegate. The Framework below is not compatible with VisionOS. I get an error when I compile: "cannot assign ViewController to delegate FrameworkDelegate"
#if os(iOS)
//for iOS target use VC for delegate assignment
self.framework.delegate = delVC
#endif
Here is where I have the ViewController header (ViewController.h)
#if OS_TARGET_IOS
#import "MyProject-Swift.h"
//for iOS target use delegate
@interface AttendanceViewController : UIViewController<FrameworkDelegate>
#else
//for VisioOS target, no delegate
@interface AttendanceViewController : UIViewController
#endif
Even though I specify in both places that the framework is used for iOS, the compiler does not allow it to compile. Does objective-c complicate the matter? I like my library function in Swift!