Question

I'm using UIGestureRecognizer for the first time and I want my app to run on iOS 3.0 onwards. Since Apple clearly states that the library is available in iOS 3.2 and later I used the following code:

// Make sure that Gesture recognition technology is supportted by the device SDK version
if ([UIGestureRecognizer instancesRespondToSelector:@selector(initWithTarget:action:)])
{
    [self initGestureRecognizers];
}

Surprisingly, when I run the App on the only target I have, that run SDK3.0, it works fine.


I replaced the condition to the following:

if ([[[UIDevice currentDevice] systemVersion] compare:@"3.2"] != NSOrderedAscending) 
{ 
    [self initGestureRecognizers]; 
}

I would love to get comments about it.

Thanks

Was it helpful?

Solution

That's probably because UIGestureRecognizer was considered private before 3.2. Don't be surprised if some things are buggy or don't quite work as expected if you use UIGestureRecognizer under 3.0.

OTHER TIPS

There are tons of undocumented APIs in every iOS release, and Apple does mention this. However use of these undocumented APIs is grounds for an App store rejection. There may well be a risk of rejection from using an API that in undocumented in one given release/revision of the OS, but documented in another, both of which your app supports.

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