Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/video/uikit/SDL_uikitviewcontroller.m
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ - (UIRectEdge)preferredScreenEdgesDeferringSystemGestures
#endif

/*
---- Keyboard related functionality below this line ----
---- related functionality below this line ----
*/
#if SDL_IPHONE_KEYBOARD

Expand Down Expand Up @@ -349,6 +349,12 @@ - (void)keyboardWillShow:(NSNotification *)notification
kbrect = [self.view convertRect:kbrect fromView:nil];

[self setKeyboardHeight:(int)kbrect.size.height];
//move stage up
[UIView animateWithDuration:0.3 animations:^{
CGRect f = self.view.frame;
f.origin.y = -setKeyboardHeight;
self.view.frame = f;
}];
#endif
}

Expand All @@ -358,6 +364,12 @@ - (void)keyboardWillHide:(NSNotification *)notification
SDL_StopTextInput();
}
[self setKeyboardHeight:0];
//move stage back down
[UIView animateWithDuration:0.3 animations:^{
CGRect f = self.view.frame;
f.origin.y = 0.0f;
self.view.frame = f;
}];
}

- (void)textFieldTextDidChange:(NSNotification *)notification
Expand Down