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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -