簡體   English   中英

解雇nsviewcontroller swift不起作用

[英]dismiss nsviewcontroller swift doesn't work

這是按鈕動作:

    @IBAction func readyPressed(sender: NSButton) {

    self.dismissController(Hardness)
    println(1)
    self.performSegueWithIdentifier("manual", sender: self)
    }

當我按下按鈕,println工作,segue工作,但NSViewController“硬度”不關閉

試試這一行來關閉窗口: self.view.window?.close()

您必須將Action從按鈕添加到First Responder - dismissController:

截圖

你可以試試

NSViewController()。解雇(VC)。

要被解除的viewcontroller應作為參數傳遞,調用者可以是任何NSViewController對象。

請嘗試使用

self.dismissViewControllerAnimated(true,completion:{});

或使用

navigationController.popViewControllerAnimated(真)

如此處所示

如何在swift中解除視圖控制器

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM