Created
September 20, 2012 18:44
-
-
Save jagbolanos/3757616 to your computer and use it in GitHub Desktop.
Change system font to views
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (void) setFont:(NSString*)fontName andFactor:(CGFloat)factor toView:(UIView*)view { | |
NSArray *subviews = view.subviews; | |
for (NSObject *subview in subviews) { | |
if ([subview isKindOfClass:[UILabel class]]) { | |
UILabel *label = (UILabel*)subview; | |
[label setFont:[UIFont fontWithName:fontName size:label.font.pointSize*factor]]; | |
} | |
if ([subview isKindOfClass:[UIView class]]) { | |
[Util setFont:fontName andFactor:factor toView:(UIView*)subview]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment