TextureGroup / Texture

Smooth asynchronous user interfaces for iOS apps.
https://texturegroup.org/
Other
8.02k stars 1.29k forks source link

Add Target on ASControl Node not responding #21

Closed iOS-GauravK closed 7 years ago

iOS-GauravK commented 7 years ago

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 commented 7 years ago

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

iOS-GauravK commented 7 years ago

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 commented 7 years ago

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

iOS-GauravK commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

[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 commented 7 years ago

@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 commented 7 years ago

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

EviluS commented 7 years ago

@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 commented 7 years ago

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