swift - How to access a method in SKScene From UIViewController -


i show uialertcontroller() using nsnotificationcenter skscene.

then when 1 of options clicked execute method in skscene(). method add node, if use

let s = gamescene() s.methodname() 

this doesnt use current reference, creat new scene , node not added

if pass scene when sending notification so

nsnotificationcenter.defaultcenter().postnotificationname("detectnot", object: self); 

after given option chosen , method execute gives error, there no info error

send notification this

nsnotificationcenter.defaultcenter().postnotificationname("detectnot", object: self); 

in uiviewcontroller method

let _scene = notification.object as! gamescene 

then can access method


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -