Runestone icon indicating copy to clipboard operation
Runestone copied to clipboard

Support for UIContentSizeCategoryAdjusting

Open ptrkstr opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. Currently apps which utilise UILabel, UITextView and UITextField are able to support dynamic type via opt in of adjustsFontForContentSizeCategory. Once a developer enables this property, users are able to have an app experience that caters to their font size preferences for example:

  • Larger font for users with difficulty seeing.
  • Smaller font for users which want to display more content at once.

Describe the solution you'd like

  • TextView conforms to UIContentSizeCategoryAdjusting.
  • adjustsFontForContentSizeCategory can be set per TextView instance.
  • Internally this updates the fonts for both line number and text editor views.

Describe alternatives you've considered Without modifying the original source code, a workaround currently is to set a new theme with updated fonts every time a user changes font size. This approach however doesn't seem as performant as only updating internal font properties directly.

Additional context

ptrkstr avatar May 14 '22 12:05 ptrkstr

This seems like a great idea, and I'd like Runestone's TextView to behave as closely to UITextView as possible, so I think we should add this.

Sorry for the late answer!

simonbs avatar Jun 17 '22 08:06 simonbs