Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Target on ASControl Node not responding #21

Closed
iOS-GauravK opened this issue Apr 18, 2017 · 10 comments
Closed

Add Target on ASControl Node not responding #21

iOS-GauravK opened this issue Apr 18, 2017 · 10 comments

Comments

@iOS-GauravK
Copy link

I added this line in LikeNode of SocialApp Layout sample,but its not working i tried creating new class again but that doesn't help.. I am not getting clue why its not calling this "likeTapped" Method
I posted this question on slack too, but no response, home somebody will this fix for me,i tried all the way i can

 [self addTarget:self action:@selector(likeTapped:) forControlEvents:ASControlNodeEventTouchUpInside];
 
 -(void)likeTapped:(id)sender {
     NSLog(@"Like Tapped");
}
@EviluS
Copy link

EviluS commented Apr 18, 2017

@Ghana93 A guess - try setting the User Interactions to enabled

@iOS-GauravK
Copy link
Author

i tried that too,But doesn't make any difference,I am stuck, what is possible reason this?
it just one line code of adding target on ASControl, I...Just....!!wow

@EviluS
Copy link

EviluS commented Apr 18, 2017

@Ghana93 Did you checked the supernode's user interaction option?

@iOS-GauravK
Copy link
Author

iOS-GauravK commented Apr 18, 2017

I don't know how to check that, but i don't think its user interaction problem, because didSelectRowis responding to every cell...

@Adlai-Holler
Copy link
Member

@Ghana93 Let's debug this! Is [ASControlNode touchesEnded:] being called? What happens when it gets called.

If not, then some other view is eating the touch – possibly the UICollectionViewCell. You should google around about how UIKit detects touches and routes them to views if you get stuck.

@iOS-GauravK
Copy link
Author

iOS-GauravK commented Apr 25, 2017

[ASControlNode touchesEnded:] not getting Called...! even if you try this on AsyncDisplayKit-master -> examples -> SocialAppLayout and add addTarget:self on LikeNode, its not working...! m Stuck..!

@EviluS
Copy link

EviluS commented Apr 25, 2017

@Ghana93 @Adlai-Holler
Interesting, I downloaded the latest version of Texture (2.3), ran the Sample of SocialAppLayout and got a crash:

libc++abi.dylib: 2017-04-25 16:04:04.339 Sample[7120:2400704] *** Terminating app due to 
uncaught exception 'NSInternalInconsistencyException', reason: 'Node <ASTextNode: 
0x7fb65b800c00; text = "Lorem ipsum dolor sit amet, consectetur adipiscing…"> does not support 
layer backing.'

commented node.layerBacked = YES; at line 190 in PostNode.m. After that I added an action for the LikesNode and it was called.

(the interesting part is the crash) :)

@iOS-GauravK
Copy link
Author

Worked For me ..! But what was that? node.layerBacked = YES; can you explain ?

@EviluS
Copy link

EviluS commented Apr 25, 2017

@Ghana93 Read this http://texturegroup.org/docs/layer-backing.html

We recommend enabling layer-backing in any custom node that doesn’t need touch handling.

@iOS-GauravK
Copy link
Author

Okay Thanks a lot....!Now its working fine..!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants