I have an app with both Objective-C and Swift based view controllers. I am programatically opening a Swift based view controller from one of my Objective-C based view controllers. The problem I am having is that I can't access the Swift variables from my Objective-C code.
My Swift code:
@IBOutlet weak var profPicture: UIImageView!
@IBOutlet weak var profVerified: UIImageView!
@IBOutlet weak var profName: UILabel!
MyProfileViewController *screen = [[MyProfileViewController alloc] initWithNibName:@"Main" bundle:nil];
self.dataPass = screen;
dataPass.profName.text = @"";
screen.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:screen animated:YES completion:nil];
Property 'passedUser' not found on object of type
You will have to declare the variable as
By default, the variables have
internal access, that means they can be accessed only from inside their module. Obj-C code is not in their module.