Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto close window using swift language osx

Tags:

macos

swift

I know this might be a very silly question but I'm a newbie for the Swift Programming Language.

I am building a sample mac application handles the user authentication. My question is how to close the window automatically using the swift.

I have tried

var window = NSWindow()
window.close()

but gives the error related to thread and opens the debugger

Please help

like image 428
Yashwanth Babu Avatar asked Apr 15 '15 13:04

Yashwanth Babu


1 Answers

In Swift, self.view.window?.close() worked for me.

like image 100
Isaiah Turner Avatar answered Nov 15 '22 06:11

Isaiah Turner