1

I could add a textfield in UIAlertController using

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Title" message:@"message" preferredStyle:UIAlertControllerStyleAlert];
[alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {

}];

Is there any possibility to add a custom textfield inside an alert controller?

pkamb
  • 30,595
  • 22
  • 143
  • 179
user6788419
  • 6,730
  • 1
  • 14
  • 26

2 Answers2

4

I do not think that it's possible to use a UITextField subclass in an UIAlertController. You can only edit the textfield's properties in the configuration handler.

André Slotta
  • 13,344
  • 2
  • 19
  • 31
1

No, you can't. You have to implement custom Alert View for this purpose. You can try libraries - ALERT ACTION SHEET LIBRARIES.

Or if you need text field with UIAlertView its self with a 'clean' look - UITextField in UIAlertController (border, backgroundColor)

Lal Krishna
  • 14,148
  • 6
  • 61
  • 73