views:

171

answers:

1

Hi There, I'm trying to use the OpenFlow project inside of my application. My target is; when the user tab to any flow item which currently UIImageView according to OpenFlow's AFItemView, it will be zoom-in in the screen (with/without animation) and then user will be able to close and get back to cower flow view in the app.

I didn't get the tocuhesBegan event when I used the default OpenFlow library, then I saw this line

 self.multipleTouchEnabled = NO;
 self.userInteractionEnabled = NO;
 self.autoresizesSubviews = YES;

in the AFOpenFlowView.m, when I change self.userInteractionEnabled = NO; to self.userInteractionEnabled = YES; I'm getting the touchesBegan event in the AFItemView.m that it already implement UIView, but flow doesn't work when I apply to this change.

I'm wondering where is the my mistake ?

Any help and example code would be appreciated.

Edit : Let me explain my goal; The target is user will open OpenFlow the scroll images with touch then when the touched any image that inside of the OpenFlow view, selected image will be come with zoom-in or flip or sth. animation. When the user touch to close icon which will be right side of the opened image, screen will be get back to the OpenFlow main screen, I did not find any solution to it on OpenFlow project. It's really urgent.

Regards

+1  A: 

I've written this answer before: http://stackoverflow.com/questions/3488201/how-to-flick-through-a-deck-of-cards/3490172#3490172

The summary:

Once hitTest:withEvent: returns a non-nil value, it's over (by default); that view "owns" the touch (see UITouch.view). Only that view gets touchesBegan/Moved/Ended/Cancelled:withEvent: callbacks.

The touches are being grabbed by AFItemView, so AFOpenFlowView never gets touch events. It may be easier to add the necessary touch-handling to AFOpenFlowView instead.

Alternatively, you can implement touch-forwarding in AFOpenFlowView. It's a bit tricky to get right.

tc.
tc. thank you for your quick answer, any example would be nice, if you provide it
fyasar
Actually, I put the touchesBegan handler to AFItemView, but handler didn't work until changed to self.userInteractionEnabled = YES; inside of the AFOpenFlowView. It still same.
fyasar
Ah, by the way, I read your http://stackoverflow.com/questions/3488201/how-to-flick-through-a-deck-of-cards/3490172#3490172 answer, OpenFlow is using UIScrollView for container, I think problem source is here, isn't it ?
fyasar
No. AFOpenFlowView uses scroll views for animation only; it sets `scrollView.userInteractionEnabled = NO;`. If you want to modify touch behaviour, consider modifying -[AFOpenFlowView touchesBegan:withEvent:]
tc.
Yep, I tried and i found touchesBegan:withEvent: inside of the AFOpenFlowView, Then i will add my desired code inside of it. Thank you very much
fyasar