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

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

Hard vs. Soft Water: What's The Difference?

The Ten Most Livable Cities In The World