From ac6f0c3f18b551181783c8857bb5cb7ed10c3e7c Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 20 Aug 2019 16:50:35 +0200 Subject: [PATCH] ui/app: (iOS) move memory pressure callback to view controller With multiple GioViewControllers we might invoke the garbage collector more than once, but in return we simplify the GioAppDelegate which will become the interface to native widgets. Signed-off-by: Elias Naur --- ui/app/os_ios.m | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/ui/app/os_ios.m b/ui/app/os_ios.m index e4757f05..641aeac5 100644 --- a/ui/app/os_ios.m +++ b/ui/app/os_ios.m @@ -63,16 +63,6 @@ static void redraw(CFTypeRef viewRef, BOOL sync) { redraw(viewRef, YES); } } - -- (void)applicationDidBecomeActive:(UIApplication *)application { -} - -- (void)applicationWillTerminate:(UIApplication *)application { -} - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - onLowMemory(); -} @end @implementation GioViewController @@ -120,6 +110,11 @@ CGFloat _keyboardHeight; redraw((__bridge CFTypeRef)view, YES); } +- (void)didReceiveMemoryWarning { + onLowMemory(); + [super didReceiveMemoryWarning]; +} + - (void)keyboardWillChange:(NSNotification *)note { NSDictionary *userInfo = note.userInfo; CGRect f = [userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];