windowDidResize protocol swift OSX -
i creating program , ui change based on size of window. i'm looking method called when window has been resized. went documentation windowdidresize, cannot work when window resized.
import spritekit import appkit class gamescene: skscene , skphysicscontactdelegate ,nswindowdelegate{ **** bunch of code **** func windowdidresize (notification: nsnotification) { hudcomp.updateposition(size) println("screen has been resized") } }
any info appreciated.
if inherit nswindowdelegate, thing should add observer onto nsnotificationcenter. code here.
nsnotificationcenter.defaultcenter().addobserver(self, selector: selector("windowdidresize:"), name: nswindowdidresizenotification, object: nil)
Comments
Post a Comment