Skip to content

Instantly share code, notes, and snippets.

@jagbolanos
Created September 20, 2012 18:44
Show Gist options
  • Select an option

  • Save jagbolanos/3757616 to your computer and use it in GitHub Desktop.

Select an option

Save jagbolanos/3757616 to your computer and use it in GitHub Desktop.
Change system font to views
+ (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