AsyncDisplayKit icon indicating copy to clipboard operation
AsyncDisplayKit copied to clipboard

[Question] How to received touch inputs

Open febinbabuc opened this issue 10 years ago • 4 comments

img_0318

I want to add an IBAction-kind touch up inside call back when user touches on the image view (ASNetworkImageNode).

I just started learning ADK 2 days ago. @Scott Goodson -- This is FFFFINGG Awesome man. Thanks.

febinbabuc avatar Jun 21 '16 10:06 febinbabuc

@modLX4: Glad you like the framework! AsyncDisplayKit does not support Interface Builder (or UIKit's autolayout). You can get touch events on any one of the ASControlNodes - ASButtonNode, ASImageNode, ASNetworkImageNode, ASTextNode, ASMapNode - with the addTarget:action:forControlEvents: method.

See more here: http://asyncdisplaykit.org/docs/control-node.html

Check out the ASDKgram sample app! It's a great example showing a social media feed with the UIKit implementation and a parallel ASDK implementation.

hannahmbanana avatar Jun 21 '16 16:06 hannahmbanana

@hannahmbanana - Thank you. Are there any support group or communities ?

febinbabuc avatar Jun 21 '16 16:06 febinbabuc

@modLX4: Check out our Slack channel! See #1582 for directions to join.

hannahmbanana avatar Jun 21 '16 17:06 hannahmbanana

I added this code in likeNode, but buttonTapped is not getting called, can you help?

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

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

iOS-GauravK avatar Apr 09 '17 09:04 iOS-GauravK