title: Accessing or referring to UIImageView from the viewController
body: <p>Total iOS/Swift newb here.  I have a View (or UIImageView, don't think it matters) on my storyBoard and I need to refer to it in my viewController code.  How do I do that?</p>
  
  <p>Why?  I'm trying to show the camera preview in a 'view' that is not full screen.</p>
  
  <p>I'm using example code for the camera, which includes this code</p>
  
  <pre><code>func beginSession() {
  var err : NSError? = nil
  captureSession.addInput(AVCaptureDeviceInput(device: captureDevice, error: &amp;err))
  
  if err != nil {
      println("error: \(err?.localizedDescription)")
  }
  
  previewLayer = AVCaptureVideoPreviewLayer(session: captureSession)
  self.view.layer.addSublayer(previewLayer)
  previewLayer?.frame = self.view.layer.frame
  captureSession.startRunning()
  }
  </code></pre>
  
  <p>that seems to be saying, put the previewLayer in the (main) 'view' on my storyboard.</p>
  
  <p>So I figured, and researched, that I could add a sub View (or a UIImageView) to my storyboard and make it the size I want, and then add previewLayer to it.</p>
  
  <p>Eg. from <a href="https://stackoverflow.com/questions/28768210/custom-camera-view-swift-ios-8-iphone-xcode-6-1">another question</a> on SO</p>
  
  <blockquote>
    <p>... and then change the part at the bottom that says,</p>
    
    <p>"previewLayer?.frame = self.view.layer.frame"</p>
    
    <p>to your 200by200 View.layer.frame</p>
  </blockquote>
  
  <p>Ok, so how do I get my 200x200 view, so I can access its frame (not even sure what layer and frame are at this point)?</p>
  
  <p>I tried control drag the view, or UIImageView to the viewController from the storyboard, but it didn't work (did nothing).</p>