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
  • 33,281
  • 23
  • 160
  • 191
user6788419
  • 7,196
  • 1
  • 16
  • 28

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,774
  • 2
  • 22
  • 34
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
  • 15,485
  • 6
  • 64
  • 84