Segueを用いて条件付きでボタンを押すと画面遷移し、遷移前のwindowを閉じるようにしたいです。
swift
1@IBAction func InputDecide(_ sender: NSButton) { 2 if (QuestionNumber == 15) { 3 performSegue(withIdentifier:NSStoryboardSegue.Identifier(rawValue: "Next"), sen der: nil) 4 self.view.window?.close() 5 } 6}
上記のようにif文の中に
performSegue(withIdentifier: NSStoryboardSegue.Identifier(rawValue: "Next"), sender: nil)
を入れたのですが、条件を満たす前に画面遷移してしまいます。また画面遷移した後に遷移前のwindowを閉じるために、```self.view.window?.close()
Cocoaを使用しております。 下の画像はStoryBoardの画像です。 回答よろしくお願いします。![StoryBoardです。](038146ca31ab86b930560a417db7aa28.png)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/03/27 12:37
2018/03/27 13:34
2018/03/28 10:21
2018/03/28 10:23
2018/03/28 12:55 編集