Firing nsviewcontroller swift does not work

What is the action of the button:

@IBAction func readyPressed(sender: NSButton) { self.dismissController(Hardness) println(1) self.performSegueWithIdentifier("manual", sender: self) } 

When I click the button, println works, segue works, but NSViewController "Hardness" does not close

+5
source share
4 answers

Try using

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

or use

navigationController.popViewControllerAnimated (true)

as presented here

how to quickly close the view manager

-8
source

Try this line to close the window: self.view.window?.close()

+21
source

You must add an action from the button to the first responder - rejectController:

screenshot

+2
source

you can try

NSViewController (). Reject (Vc).

must be passed as an argument to the viewcontroller, and any NSViewController can be the caller.

0
source

Source: https://habr.com/ru/post/1210726/


All Articles