Last active
January 1, 2016 11:59
-
-
Save jeffbailey/8141224 to your computer and use it in GitHub Desktop.
How to use custom fonts that respond to Dynamic Type size changes.
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
NSNoticationCenter *center = [NSNotificationCenter defaultCenter]; | |
[center addObserver: self selector:@selector(dynamicTypeChanged:) name: UIContentSizeCategoryDidChangeNotification | |
object:nil]; | |
- (void) dynamicTypeChanged:(NSNotification *) note { | |
UIApplication *app = [UIApplication sharedApplication]; | |
NSString *category = app.preferredContentSizeCategory; | |
if ([category isEqual:UIContentSizeCategorySmall]) { | |
... | |
} else if ([category isEqual:UIContentSizeCategoryMedium]) { | |
... | |
} else if ([category isEqual:UIContentSizeCategoryLarge]) { | |
... | |
} else ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment