ios - UIScrollView in sprite kit -
i new programming , developing ios game. have used 1 view controller, initializes home skscene , isn't used @ after that, , have around 6 skscenes can navigate between each other following code (in respective scenes)
skscene *storescene = [[skscenestore alloc] initwithsize:self.size]; sktransition *reveal = [sktransition fadewithduration:0.5]; [self.view presentscene:storescene transition:reveal];
one of scenes store, , use scroll-kit (basically customizing code found here ) scroll through objects on store.
in github link above, implements sprite-kit uiscrollview, have tried move uiscrollview code store skscene
- (void)scrollviewdidscroll:(uiscrollview *)scrollview
doesn't called in sprite-kit scene. (i trying combine these store skscene because skscenes have nothing view controller, , feel messy keeping track of skscene , whether or not uiscrollview exists in view controller).
so question: how can get
- (void)scrollviewdidscroll:(uiscrollview *)scrollview
to fire off if in skscene rather uiviewcontroller?
to so, make use of nsnotificationcenter
1: in viewdidload() add
nsnotificationcenter.defaultcenter().addobserver(self, selector: "facebook", name: "facebookshare", object: nil)
2: in method whereby want pass function uiviewcontroller
toskscene
nsnotificationcenter.defaultcenter().postnotificationname("facebookshare", object: nil)
Comments
Post a Comment