title: Swift 3 PreviewView created optional but cannot connect it to original AVCAM class previewView
body: <p>i am making an app where it has two files CameraVC.swift</p>
  
  <pre><code>import UIKit
  class CameraVC: CameraViewController {
  @IBOutlet weak var previewView: PreviewView!
  override func viewDidLoad() {
      super.viewDidLoad()   
      self.previewView = previewView   
  }
  </code></pre>
  
  <p>}</p>
  
  <p>another class CameraViewController.swift
  <a href="https://developer.apple.com/library/content/samplecode/AVCam/Listings/Swift_AVCam_CameraViewController_swift.html#//apple_ref/doc/uid/DTS40010112-Swift_AVCam_CameraViewController_swift-DontLinkElementID_15" rel="nofollow noreferrer">Apple AVCAM class</a></p>
  
  <p>in this class i have changed removed the outlet and now this is the new code</p>
  
  <pre><code>private weak var previewView: PreviewView?
  </code></pre>
  
  <p>everywhere in this file i have changed it to previewView? (every call optional)</p>
  
  <p>but this is when i am assigning the CameraVC.swift 
  its giving the error "<strong>Assigning a property to itself</strong>"</p>
  
  <p>and the cameraVC.main code is added</p>
  
  <p>if anyone had this problem and solved it pls let me know the solution...i am facing this problem from last 2 days....it will be a great help to me</p>