take the modal controller as an example:Under normal circumstances, if the keyboard is displayed in the interface, dismiss the current controller, then the controller's view will first exit, the keyboard will be more than the controller's view delay exit. Workaround: Exit the keyboard before dismiss the controller view, and then dismiss the controller's view[self. View endediting:YES]; [self dismissviewcontrolleranimated:YES completion:nil]; Although the above two lines of code solve the problem, but will find that the controller's view is dismiss, leaving the interface of the animation execution faster than before-the flashback. To solve the problem of the controller's view quick flash. a better approach://Exit the keyboard first, delay0.2Seconds laterAgainDismissController
[Self.ViewEndediting:YES];
Dispatch_after(Dispatch_time(Dispatch_time_now, (int64_t)(0.2*Nsec_per_sec)),Dispatch_get_main_queue(), ^{
[Self dismissviewcontrolleranimated:YES completion:nil];
});
Self-creation solves the problem of the keyboard last exit