swift - How to save NSWindow position for multiple screen? -


i setting autosavename window in ib. in windowcontroller of window doing following -

  override func windowdidload() {         super.windowdidload()          // implement method handle initialization after window controller's window has been loaded nib file.         self.window?.setframeusingname("testwindowcontollerautosavename")     } 

this simple possibly can be. works if use on single screen. if using multiple screens initial window position on main screen. doesn't remember screen app quit. have tried (with no luck) -

  override func windowdidload() {         super.windowdidload()          // implement method handle initialization after window controller's window has been loaded nib file.         let framestring = self.window?.stringwithsavedframe         if let _ = framestring{             self.window?.setframefromstring(framestring!)         }     } 

how correctly use setframeusingname method? help.

this because uiviews embedded within uiwindow. each uiview, or 'screen' called it, subview of uiwindow. can think of uiwindow parent of uiview. if want edit 1 uiview, consider working uiview.

you can read more view , window architecture. have helpful diagram there visualize explanation.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -