Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIAppearance for UILabel in UIActivityViewController

I have this code that changes the appearance of UILabels when they appear in UIAlertControllers:

UILabel *appearanceLabel = [UILabel appearanceWhenContainedInInstancesOfClasses:@[[UIAlertController class]]];
    [appearanceLabel setAppearanceFont:kFontRegular(18)];

But this also affects the UILabels that appear in UIActivityViewControllers.

enter image description here

How can I exclude the UILabels in UIActivityViewController?

like image 548
Halpo Avatar asked Feb 22 '16 16:02

Halpo


1 Answers

Instead of trying to set / unset the appearance depending on your situation you may be able to subclass your own UIAlertController and use

UILabel *appearanceLabel = [UILabel appearanceWhenContainedInInstancesOfClasses:@[[MyAlertController class]]];
    [appearanceLabel setAppearanceFont:kFontRegular(18)];

then when the action sheet opens it won't be your subclass so the rule won't apply.

like image 155
Steve Avatar answered Sep 28 '22 12:09

Steve