diff -r 1889c850fafc src/video/uikit/SDL_uikitviewcontroller.m --- a/src/video/uikit/SDL_uikitviewcontroller.m Wed Nov 30 22:06:05 2016 -0800 +++ b/src/video/uikit/SDL_uikitviewcontroller.m Thu Dec 01 13:27:10 2016 -0600 @@ -58,6 +58,7 @@ #if SDL_IPHONE_KEYBOARD UITextField *textField; + BOOL rotatingOrientation; #endif } @@ -70,6 +71,7 @@ #if SDL_IPHONE_KEYBOARD [self initKeyboard]; + rotatingOrientation = FALSE; #endif #if TARGET_OS_TV @@ -211,6 +213,28 @@ } } +#if TARGET_OS_TV || defined(__IPHONE_8_0) +- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator +{ + [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; + rotatingOrientation = TRUE; + [coordinator animateAlongsideTransition:^(id context) {} + completion:^(id context) { + rotatingOrientation = FALSE; + }]; +} +#else +- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { + [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; + rotatingOrientation = TRUE; +} + +- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { + [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; + rotatingOrientation = FALSE; +} +#endif /* TARGET_OS_TV || defined(__IPHONE_8_0) */ + - (void)deinitKeyboard { #if !TARGET_OS_TV @@ -251,7 +275,8 @@ - (void)keyboardWillHide:(NSNotification *)notification { - SDL_StopTextInput(); + if (!rotatingOrientation) + SDL_StopTextInput(); [self setKeyboardHeight:0]; }