title: Import Extension file in Swift
body: <p>I create an extension for UIView in Swift. Anyone knows how to import that file to my UIViewController?</p>
  
  <p>I want to import the extension file in the controller file, in that way I can reuse the extension file. For example an structure like this:</p>
  
  <p>UIViewExtension.swift</p>
  
  <pre><code>import UIKit
  
  extension UIView {
      var myVar : Float {
          get {
              return myVar
          }
          set (newMyVar) {
              myVar = newMyVar
          }
      }
  }
  </code></pre>
  
  <p>ViewController.swift</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
          var squareView: UIView = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
  
          squareView.myVar = 50
  
          self.view.addSubview(squareView)
          println("Offset: \(squareView.myVar)")
      }
  }
  </code></pre>
  
  <p>This is the error given by the compiler:</p>
  
  <p><code>Command /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254</code></p>