假设您有一个空白的Xcode项目,没有故事板,没有测试,没有coredata,所有.xib文件都消失了。你如何使用swift 3/4以编程方式在AppDelegate中呈现一个简单的窗口? 我是macOS编程的新手,我无法弄明白。
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var window: NSWindow!
func applicationDidFinishLaunching(_ aNotification: Notification) {
// What the f**k do I need to do here? :/
}
func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}
}