It was indeed a private api and not supported in versions prior to 3.2.
Apple's doc says:
To determine at runtime whether you can use gesture recognizers in
your application, test whether the class exists and, if it does,
allocate an instance and see check if it responds to the selector
locationInView:. This method was not added to the class until iOS 3.2.
Sample code:
UIGestureRecognizer *gestureRecognizer = [[UIGestureRecognizer alloc] initWithTarget:self action:@selector(myAction:)];
if (![gestureRecognizer respondsToSelector:@selector(locationInView:)]) {
[gestureRecognizer release];
gestureRecognizer = nil;
}
// do something else if gestureRecognizer is nil
Explenation:
To determine whether a class is available at runtime in a given iOS
release, you typically check whether the class is nil. Unfortunately,
this test is not cleanly accurate for UIGestureRecognizer. Although
this class was publicly available starting with iOS 3.2, it was in
development a short period prior to that. Although the class exists in
an earlier release, use of it and other gesture-recognizer classes are
not supported in that earlier release. You should not attempt to use
instances of those classes.
Check out the full text here.