I know I posted this in the other Gold Challenge thread, but I wanted to break this out into its own topic because I want to fully understand how to “drop in” gesture recognizers when I want them (dynamically), and I wanted to have a longer discussion about it.
So, the conventional wisdom is that to solve the Gold Challenge in chapter 19, you will have to use a UIScrollView and just kind of “piggyback” off of its natural scaling feature. To me, though, this seems less than ideal. It seems like the best solution would be to just drop down a UIPinchGestureRecognizer on the popover’s view and then respond to its events by usings its scale and velocity properties.
And on the surface it seems like this would be an easy thing to do. I think that if there were not this block thing involved (and I’m still not sure why we did that in the first place), the whole thing would be a lot easier. When I try it, though (and I’ve tried it many different ways), I can never get the target action to fire on the pinch gesture recognizer. At all. I just have a dummy method set up to send an NSLog message, so I’m not even trying to zoom the view yet, but I still can’t figure it out.
Has anyone else tried this method? Is it somehow completely hopeless and I just don’t know it? Is there some aspect of the block construction that is messing me up that I need to be aware of? Please help!