title: Delegate is nil in a Swift program
body: <p>I'm practising how to communicate between two view controllers using protocol and delegate (in the xCode background even when I'm using protocol in my project I get the same problem, Delegate is nil), but the problem after setting everything it shows me that my delegate is nil and the sender VC does not send any data since the delegate is nil.</p>
  
  <p>I have confirmed to the protocol and I have set the receiver VC as the delegate, but still can not see where the problem is.</p>
  
  <p>The Protocol</p>
  
  <pre><code>protocol theCommunicationsStructionProtocol{
  
  func dataToTransmit(Data: String)
  
  }
  </code></pre>
  
  <p>The Sender VC</p>
  
  <pre><code>class TheSenderVC{
  
  var delegate: theCommunicationsStructionProtocol?
  
  func lookingForDelegate(){
  
  
  self.delegate?.dataToTransmit(Data: "Data has been sent")
  
   }
  }
  </code></pre>
  
  <p>The Receiver VC</p>
  
  <pre><code>class TheReceiverVc1: theCommunicationsStructionProtocol{
  var TheSenderVCObj = TheSenderVC()
  
  func delegateLuncher(){
  
  TheSenderVCObj.delegate = self
  }
  
  func dataToTransmit(Data: String) {
  print("from VC1: \(Data)")
   }
  
  }
  </code></pre>
  
  <p>calling delegateLuncher() to set the delegate in the receiver VC</p>
  
  <pre><code>TheSenderVC().lookingForDelegate()
  </code></pre>
  
  <p>calling lookingForDelegate() from the sender VC to look for the 
  delegate and send it the data</p>
  
  <pre><code>TheReceiverVc1().delegateLuncher()
  </code></pre>
  
  <p>Note: I have tried accessing the delegate from the receiver VC using this way:</p>
  
  <pre><code>class TheReceiverVc1: theCommunicationsStructionProtocol{
   var TheSenderVCObj: TheSenderVC?
  
  func delegateLuncher(){
  
  self.TheSenderVCObj?.delegate = self
  }
  
  func dataToTransmit(Data: String) {
  print("from VC1: \(Data)")
   }
  
  }  
  </code></pre>
  
  <p>but I still getting the same problem:</p>
  
  <blockquote>
    <p>delegate is nil</p>
  </blockquote>