blueapron / styled-text

Declarative text styles and streamlined Dynamic Type support for iOS
MIT License
235 stars 5 forks source link

Implement Dynamic Type support #3

Closed huebnerob closed 7 years ago

huebnerob commented 7 years ago

This PR implements Dynamic Type support.

TextStyle has a new parameter to define whether it should scale to the system font size.

DynamicTypeController is a new class that handles both system-wide and app-specific font size category definition and changes. There is a shared instance available for default usage.

More advanced cases are enabled by setting the controller property of your TextStyle to a custom DynamicTypeController that you can customize independently of the default shared instance. This would allow a specific screen in your app to have it's own font size slider, for example.

huebnerob commented 7 years ago

Code was reviewed by @edmonston on this app PR: https://github.com/blueapron/iphone-application/pull/2091

Merging.