0

I already implanted a code that allows 99% of the font of my application to some specific fonts:

@implementation UILabel(SizedFontName) //APPEARANCE
- (void)setSizedFontName:(id)test UI_APPEARANCE_SELECTOR
{
    NSString *fontName = self.font.fontName;
    CGFloat fontSize = self.font.pointSize;

    if ([[fontName lowercaseString] rangeOfString:@"bold"].location != NSNotFound || [[fontName lowercaseString] rangeOfString:@"fb"].location != NSNotFound)
    {
        self.font = [UIFont fontWithName:nameFontBold size:fontSize];
    }
    else if ([[fontName lowercaseString] rangeOfString:@"italic"].location != NSNotFound)
    {
        self.font = [UIFont fontWithName:nameFontItalic size:fontSize];
    }
    else
    {
        self.font = [UIFont fontWithName:nameFontRegular size:fontSize];
    }
}
@end

I call it with the line:

//APPEARANCE
    [[UILabel appearance] setSizedFontName:nil];  

That works well but I would like to have the same to complete my application with the alert views that seems to escape to that piece of code...

Thanks in advance.

ΩlostA
  • 2,501
  • 5
  • 27
  • 63
  • You shouldn't customize UIAlertView (or UIAlertViewController). It's not recommended. You should if you want customization to do your own Alert. – Larme Jan 04 '19 at 10:26
  • you can user Attributed string in your alert. like 1. https://stackoverflow.com/questions/44130347/uialertcontroller-set-attributed-messages . 2. https://iosdevcenters.blogspot.com/2016/05/hacking-uialertcontroller-in-swift.html – Gagan_iOS Jan 04 '19 at 11:22

0 Answers0