title: Delegate in Swift-language
body: <p>I have two controllers and i need call up function the first controller to second controller:
  In second controller I have created protocol and init delegate in class:</p>
  
  <pre><code>    protocol testProtocol {
          func testDelegate() // this function the first controllers
      }
  
      class SecondViewController: UIViewController {
          var delegate: testProtocol?
      ....
      }
      @IBAction func testDelegateClicked(sender : AnyObject) {
              delegate?.testDelegate()
          }
  </code></pre>
  
  <p>First Controller
          <pre>
          class ViewController: UIViewController, testProtocol {</p>
  
  <code>        var secondController: SecondViewController = SecondViewController()
  
          override func viewDidLoad() {
              super.viewDidLoad()
  
              secondController.delegate = self
          }
          func testDelegate() {
              println("Hello delegate")
          }&lt;/pre&gt;
  </code></pre>
  
  <p>But function not getting called</p>