Check for selectors UIScreen responds to, not the base system version.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 19 Nov 2011 19:18:20 -0500
changeset 6089 30d57832687a
parent 6088 eedb8e10ac22
child 6090 687400b595ab
Check for selectors UIScreen responds to, not the base system version. Thanks to Vittorio Giovara for the patch!
src/video/uikit/SDL_uikitvideo.m
--- a/src/video/uikit/SDL_uikitvideo.m	Sat Nov 19 19:13:55 2011 -0500
+++ b/src/video/uikit/SDL_uikitvideo.m	Sat Nov 19 19:18:20 2011 -0500
@@ -201,10 +201,8 @@
 {
     _this->gl_config.driver_loaded = 1;
 
-    NSString *reqSysVer = @"3.2";
-    NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
-    if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending)
-        SDL_UIKit_supports_multiple_displays = YES;
+    // this tells us whether we are running on ios >= 3.2
+    SDL_UIKit_supports_multiple_displays = [UIScreen instancesRespondToSelector:@selector(currentMode)];
 
     // Add the main screen.
     UIScreen *uiscreen = [UIScreen mainScreen];