title: Cannot access Swift var from Objective-C View controller - iOS
body: <p>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.</p>
  
  <p>My Swift code:</p>
  
  <pre><code>@IBOutlet weak var profPicture: UIImageView!
  @IBOutlet weak var profVerified: UIImageView!
  @IBOutlet weak var profName: UILabel!
  var passedUser:PFUser!
  </code></pre>
  
  <p>My Objective-C code:</p>
  
  <pre><code>MyProfileViewController *screen = [[MyProfileViewController alloc] initWithNibName:@"Main" bundle:nil];
  self.dataPass = screen;
  dataPass.profName.text = @"";
  screen.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
  [self presentViewController:screen animated:YES completion:nil];
  </code></pre>
  
  <p>I am able to access @ properties like IBOutlets, but I can't access and edit the var objects. </p>
  
  <p>I am doing this, because I want to pass data into the Swift based view controller from the Objective-C based view controller when I am presenting the Swift based view controller.</p>
  
  <p>Why can't I access the var objects?</p>
  
  <p>Here is the error I am getting:</p>
  
  <p><a href="https://i.stack.imgur.com/FqvjE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/FqvjE.png" alt="enter image description here"></a></p>
  
  <p>The error is as follows:</p>
  
  <blockquote>
    <p>Property 'passedUser' not found on object of type
    'MyProfileViewController *'</p>
  </blockquote>
  
  <p>Thanks for your time, Dan.</p>