3 Replies
      Latest reply on Oct 11, 2019 11:03 AM by janabanana
      narcisfromgirona Level 1 Level 1 (0 points)

        How to position the window of the app from the beginning, when the app launches?

         

        This works well if I put in a button:

         

        @IBActionfunc test(_ sender: NSButton) {
             view.window?.setFrame(NSRect(x:0,y:0,width:500,height:500), display: true)
        }

         

        But it does not work if I put in the viewDidLoad or ViewDidAppear:

         

        overridefunc viewDidLoad() {
                super.viewDidLoad()
        
                view.window?.setFrame(NSRect(x:0,y:0,width:500,height:500), display: true)
            }