Texture icon indicating copy to clipboard operation
Texture copied to clipboard

Add target on ControlNode not working

Open garrettmoon opened this issue 9 years ago • 2 comments

From @Ghana93 on April 16, 2017 11:41

i added this code in LikeNode (in init method) of social app example,but its not working

[self addTarget:self action:@selector(likeTapped:) forControlEvents:ASControlNodeEventTouchUpInside];

-(void)likeTapped:(id)sender {
 NSLog(@"Like Button Pressed");
}

Please help Thank you, Gaurav

Copied from original issue: facebookarchive/AsyncDisplayKit#3276

garrettmoon avatar May 02 '17 00:05 garrettmoon

@Ghana93 it looks like it's because the PostNode is changing it to be layer backed. In the latest master we've added an assert that prevents this. So now the example asserts on load when the PostNode tries to make it layer backed.

garrettmoon avatar May 02 '17 00:05 garrettmoon

Yes,By Removing code from line 186 to 188 in PostNode.m,

  for (ASDisplayNode *node in self.subnodes) {
        node.layerBacked = YES;
   }

i was able to perform action task.. Thank You

iOS-GauravK avatar May 02 '17 07:05 iOS-GauravK