title: Cannot access variables in a Swift class from Objective-C file
body: <p>I'm trying to continue with Swift in an existing project I had started in Objective-C.  I followed the <a href="https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html" rel="nofollow">Apple documentation</a> and I managed to access a Swift class from an Objective-C file, via including the <em>"ProductModuleName-Swift.h"</em> header in my Obj-C file.</p>
  
  <p>At this point here's my code:</p>
  
  <pre><code>#include "Pianoconcert_App-Swift.h"
  
  @interface ModelsVC ()
  
  @end
  
  @implementation ModelsVC
  // And all that kind of stuff
  // ...
  -(IBAction)comanda:(UIButton *)sender {
      ComandaTableVC *controller = (ComandaTableVC *)self.tabBarController.viewControllers[2];
      // Here goes the problematic code
      [self.tabBarController setSelectedIndex:2];
  }
  </code></pre>
  
  <p>This piece of code has no problems.  But now I just want to set one of the variables in the Swift class like this: <code>controller.selectedModel = sender.tag</code>, but Xcode just tells me the variable does not exist.</p>
  
  <p>Here's an extract of my Swift class:</p>
  
  <pre><code>import UIKit
  
  class ComandaTableVC: UITableViewController, UIPickerViewDataSource, UIPickerViewDelegate {
      // Declaration of some constants and variables
      // And here goes the one
      var selectedModel: Int = 0
      // And a bunch more of variables and functions
      // ...
  }
  </code></pre>
  
  <p>I don't know what I'm doing wrong.  The class seems fully included and, actually, I can access that variable and all the others if I use the class from <strong>another Swift file</strong>, like this: </p>
  
  <pre><code>var controller: ComandaTableVC = self.tabBarController.viewControllers[2] as ComandaTableVC
  controller.selectedModel = 2
  </code></pre>