I'm trying to pass a simple string from a Swift Controller to an Objective-C controller, but unfortunately it doesn't work.
Error I get:
Value of type 'EUIDViewController' has no member 'stringPassed'
Swift Code sending string
let pvc = EUIDViewController(nibName: "ScannerViewController", bundle: nil)
if isHasCameraPermission {
pvc.stringPassed = "test"
present(pvc, animated: true, completion: { _ in })
}
Objective-C code receiving the string
@property (strong, nonatomic) NSString* stringPassed;
- (void)viewDidLoad {
[super viewDidLoad];
[self initOCR];
NSLog(@"String: %@", self.stringPassed);
}
Update: I did #import "EUIDViewController.h" into the bridging-header