We had some consultants who created some kind of code for us, and the way they were laid out was UIScrollView and UIView inside it.
There is another UIView icon that is added as a subset of the scrollView based on the selection in the table. When this icon is selected, a popover will appear. In the actual Popover code, they use gesture representation to compute the frame and where to present the popover.
Now I am tasked to present a popover with a selection in the table. When zoom = 1, it is quite easy. I just grab the size of the UIScrollView, figure out where I add the icon, and then present the view from that icon.
When I do this with a different zoom level, my code falls apart, since I donβt know exactly where I am in scrollView. I register the consultants' gestures according to their method, and they will get the starting position at 5000. That's why I ask how the locationInView works inside the scrollView to try to figure out where I am in yPosition to present my popover from in the right place. Any thoughts? Thanks.
- (void)handleSingleTap:(UIGestureRecognizer *)sender { id targetView = [sender view]; CGPoint point = [sender locationInView:self.scrollView]; NSLog(@"point: %f %f", point.x, point.y);
source share