Cocoa: How to set window title from within view controller in Swift?
问题 I've tried to build on a Cocoa app which uses storyboard and Swift in Xcode 6. However, when I tried to alter the title of window from within NSViewController , the following code doesn't work. self.title = "changed label" When I wrote the above code in viewDidLoad() function, the resultant app's title still remains window . Also, the following code causes an error, since View Controller doesn't have such property as window . self.window.title = "changed label" So how can I change the title