So I have and app that has a custom UIAlertView (by custom I mean adding the UILabel at the bottom programatically). It works just fine on iOS < 11, but in iOS 11 it fails miserably. So, on iOS 10 it works fine (left) but it fails in iOS 11 (right) with the same code of course
And this is the code that I am using to make the custom UAlertView. Any ideas?
SessionManager *sessionMgr = [SessionManager sharedManager];
NSString *saludoStr = [NSString stringWithFormat:@"¡Bienvenido %@!",self.datosPersonalesResponse.nombre];
NSString *mailStr = [sessionMgr getUserEmail];
NSString *mensajeStr = [NSString stringWithFormat:@"Te hemos enviado un email de \nactivación de cuenta a: \n\n%@\n\nActivá tu cuenta para recibir alertas,\n avisos recomendados y postularte a \nempleos.\n",mailStr];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:saludoStr message:@"" delegate:self cancelButtonTitle:@"Cerrar" otherButtonTitles:@"No lo recibí", nil];
UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
lbl.numberOfLines= 0;
[lbl setFont:[UIFont fontWithName:@"OpenSans" size:13]];
[lbl setTextColor:[UIColor colorWithRed:146/255.0f green:146/255.0f blue:146/255.0f alpha:1.0]];
NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:mensajeStr];
[attributedStr addAttribute:NSFontAttributeName
value:[UIFont fontWithName:@"OpenSans-Semibold" size:16]
range:NSMakeRange(56,[mailStr length])];
[attributedStr addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(56,[mailStr length])];
lbl.attributedText = attributedStr;
lbl.textAlignment = NSTextAlignmentCenter;
[alert setValue:lbl forKey:@"accessoryView"];
[alert show];
UIAlertView is deprecated. Please consider using UIAlertController with full details here.