Last active
February 15, 2019 17:42
-
-
Save keehun/5a02d17c6346a22129f62396b5ccae9c to your computer and use it in GitHub Desktop.
Practical Dynamic Type: Attributed Strings, Snippet 2
This file contains hidden or 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
| // ... | |
| label.adjustsFontForContentSizeCategory = true | |
| NotificationCenter.default.addObserver(self, | |
| selector: #selector (uiContentSizeCategoryChanged), | |
| name: .FontMetricsContentSizeCategoryDidChange, | |
| object: nil) | |
| // ... | |
| // ... | |
| // MARK: Event Handlers | |
| /// Update the sizes of all contained fonts whenever the Dynamic Type size changes. | |
| @objc func uiContentSizeCategoryChanged() { | |
| /// Handle contentSizeCategoryDidChange, here. | |
| } | |
| // ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment