swift délégué entre deux-vue-contrôleur sans segue

Mon délégué protocole ne s'est jamais appelé

Mon premier contrôleur - ViewController

class ViewController: UIViewController,testProtocol {

    @IBAction func btInit(sender: AnyObject) {
        println("Bt Init")

        let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
        let initViewController: UIViewController = storyBoard.instantiateViewControllerWithIdentifier("viewTarget") as targetViewController
        self.presentViewController(initViewController,animated: false, nil)

    }

    var targetController = targetViewController();

    override func viewDidLoad() {
        super.viewDidLoad()
        self.targetController.delegate = self
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        //Dispose of any resources that can be recreated.
    }

    func testDelegate(){
        println(" in my view controller delegate ")
    }
}

Dans mon second point de vue, contrôleur targetViewController

protocol testProtocol {
    func testDelegate() //this function the first controllers
}

class targetViewController: UIViewController {

    @IBAction func BtTarget(sender: AnyObject) {

        println("bt target pressed")

        delegate?.testDelegate()
    }

    var delegate : testProtocol?

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

    func testDelegate(){
        println(" in my target view controller delegate ")
    }
}

Pourquoi est testDelegate() ne s'est jamais appelé sur ViewController? Ce que je fais mal? Merci.

J'ai lu beaucoup de posts sur ce sujet, mais tous les exemples sont donnés avec des enchaînements de transition, et je ne veux pas utiliser un segue.

InformationsquelleAutor user2718075 | 2015-07-04