src/video/uikit/SDL_uikitvideo.m
branchiOS-improvements
changeset 9502 933ed557b7c1
parent 9488 f15520430c94
child 9505 6fc615dfc93f
     1.1 --- a/src/video/uikit/SDL_uikitvideo.m	Wed Jul 23 03:05:31 2014 -0300
     1.2 +++ b/src/video/uikit/SDL_uikitvideo.m	Wed Jul 23 21:55:42 2014 -0300
     1.3 @@ -130,6 +130,26 @@
     1.4      UIKit_QuitModes(_this);
     1.5  }
     1.6  
     1.7 +BOOL
     1.8 +UIKit_IsSystemVersionAtLeast(NSString *version)
     1.9 +{
    1.10 +    NSString *sysversion = [UIDevice currentDevice].systemVersion;
    1.11 +    return [sysversion compare:version options:NSNumericSearch] != NSOrderedAscending;
    1.12 +}
    1.13 +
    1.14 +CGRect
    1.15 +UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen)
    1.16 +{
    1.17 +    BOOL hasiOS7 = UIKit_IsSystemVersionAtLeast(@"7.0");
    1.18 +
    1.19 +    if (hasiOS7 || (window->flags & (SDL_WINDOW_BORDERLESS|SDL_WINDOW_FULLSCREEN))) {
    1.20 +        /* The view should always show behind the status bar in iOS 7+. */
    1.21 +        return screen.bounds;
    1.22 +    } else {
    1.23 +        return screen.applicationFrame;
    1.24 +    }
    1.25 +}
    1.26 +
    1.27  /*
    1.28   * iOS log support.
    1.29   *