I have overridden the -inputAccessoryView:
method in a UIViewController which returns a view which is displayed on top of the keyboard which is shown while editing a UITextField
on the viewController's view.
-(UIView *)inputAccessoryView;
I am also presenting a UIAlertController from the viewController.
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Save Profile" message:@"You have made changes to your profile. Do you want to save them?" preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
[alert addAction:[UIAlertAction actionWithTitle:@"Save" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
//Code to save the profile.
}]];
[self presentViewController:alert animated:YES completion:nil];
As you can see I have not added any textField to the UIAlertController.
Weirdly, the inputAcessoryView turns up at the bottom of the screen when the UIAlertController is presented.
Is this a bug, or have I overlooked something?