mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 00:45:35 +00:00
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>
This commit is contained in:
+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];
|
||||
|
||||
Reference in New Issue
Block a user