Question

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

Was it helpful?

Solution

I've written this answer before: How to flick through a deck of cards?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top