say-their-names-ios icon indicating copy to clipboard operation
say-their-names-ios copied to clipboard

Implement self-resizing fonts using scaledFont(:) for dynamic text

Open hybridcattt opened this issue 4 years ago • 0 comments

Summary

Right now fonts throughout the app are not self-resizing. They only look at textStyle when created, and don't update when text sizing settings change. Currently some custom views subscribe to traitCollectionDidChange, where fonts are reapplied to the UI elements.

Fonts created via scaledFont(:) font function don't require additional logic to re-apply fonts on labels, as font objects themselves update internally.

Working on this ticket involves modifying dynamicFont(...) function and removing custom font re-application code currently sprinkled throughout the app.

Expected behaviour

When text size is changed in accessibility settings, views throughout the app update automatically to reflect the new text size.

How does it improve the project?

Using a native solution to the problem and having less custom code in the app increases maintainability of the codebase.

Moved from Trello: https://trello.com/c/mOaYUyR2/88-implement-self-resizing-fonts-using-scaledfont

hybridcattt avatar Jul 14 '20 14:07 hybridcattt