src/video/uikit/SDL_uikitview.m
changeset 9727 b845f659e015
parent 9619 b94b6d0bff0f
child 9861 2117766ff8d2
     1.1 --- a/src/video/uikit/SDL_uikitview.m	Tue Jun 09 21:06:55 2015 +0200
     1.2 +++ b/src/video/uikit/SDL_uikitview.m	Tue Jun 09 21:08:24 2015 -0300
     1.3 @@ -62,6 +62,7 @@
     1.4          return;
     1.5      }
     1.6  
     1.7 +    /* Remove ourself from the old window. */
     1.8      if (sdlwindow) {
     1.9          SDL_uikitview *view = nil;
    1.10          data = (__bridge SDL_WindowData *) sdlwindow->driverdata;
    1.11 @@ -71,9 +72,7 @@
    1.12          [self removeFromSuperview];
    1.13  
    1.14          /* Restore the next-oldest view in the old window. */
    1.15 -        if (data.views.count > 0) {
    1.16 -            view = data.views[data.views.count - 1];
    1.17 -        }
    1.18 +        view = data.views.lastObject;
    1.19  
    1.20          data.viewcontroller.view = view;
    1.21  
    1.22 @@ -83,6 +82,7 @@
    1.23          [data.uiwindow layoutIfNeeded];
    1.24      }
    1.25  
    1.26 +    /* Add ourself to the new window. */
    1.27      if (window) {
    1.28          data = (__bridge SDL_WindowData *) window->driverdata;
    1.29