~eliasnaur/gio

ac6f0c3f18b551181783c8857bb5cb7ed10c3e7c — Elias Naur 6 months ago e6a68db
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 <mail@eliasnaur.com>
1 files changed, 5 insertions(+), 10 deletions(-)

M ui/app/os_ios.m
M ui/app/os_ios.m => ui/app/os_ios.m +5 -10
@@ 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];