prewarm soft keyboard on app launch

This commit is contained in:
TrueZhuanjia committed 2025-12-28 22:19:30 +08:00
1 parent 22e270c4df
commit 9c18ab4142
1 file changed
+13
@@ -1681,6 +1681,19 @@ static NSMutableSet* hostList;
GCController* controller = note.object; GCController* controller = note.object;
[self unregisterControllerCallbacks:controller]; [self unregisterControllerCallbacks:controller];
}]; }];
[self prewarmSoftKeyboard];
}
- (void)prewarmSoftKeyboard {
dispatch_async(dispatch_get_main_queue(), ^{
UITextField *tf = [[UITextField alloc] initWithFrame:CGRectZero];
tf.hidden = YES;
[[UIApplication sharedApplication].windows.firstObject addSubview:tf];
[tf becomeFirstResponder];
[tf resignFirstResponder];
[tf removeFromSuperview];
});
} }
-(void)viewDidLayoutSubviews{ -(void)viewDidLayoutSubviews{