title: swift delegate function is not called
body: <p>I know the same question is asked many times. I read most of  the answers from stack overflow and tried. But it did not help my problem.</p>
  
  <p>I have two view controllers</p>
  
  <pre><code>protocol UpdateDataDelegate {
      func loadData()
  }
  
  viewcontroller2 {
  var delegate: UpdateDataDelegate?
  
  override func viewDidLoad() {
          super.viewDidLoad()
  
  }
  
  fun saveData() {
     self.delegate?.loadData()
  }
  }
  
  viewcontroller1 : UpdateDataDelegate {
  
  var vc2 = viewcontroller2()
  
  override func viewDidLoad() {
          super.viewDidLoad()
  
  vc2.delegate = self
  
  }
  
  func loadData() {
  
  }
  
  }
  </code></pre>
  
  <p>But function loadData() from viewcontroller1 is not called. </p>