How can I easily save the Window size and position state using Obj-C?

前端 未结 9 686
灰色年华
灰色年华 2021-02-02 09:19

What is the best way to remember the Windows position between application loads using Obj-C? I am using Interface Builder for the interface, is it possible to do this with bind

9条回答
  •  别跟我提以往
    2021-02-02 09:39

    In Swift:

    class MainWindowController : NSWindowController {
        override func windowDidLoad() {
            shouldCascadeWindows = false
            window?.setFrameAutosaveName("MainWindow")
    
            super.windowDidLoad()
        }
    

提交回复
热议问题