Fix iOS 16 UITextView intrinsicContentSize bug #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduction
Using latest Xcode 14 beta, unit tests for
TypographyTextView
would fail when targeting iOS 16.Purpose
Fix our text view so that it sizes itself properly (as a multiple of line height) under iOS 16
Scope
TypographyTextView
Discussion
Starting with iOS 16,
UITextView
uses TextKit 2 text layout manager to render text view content. For whatever reason, when rendered in this manner the text view's intrinsic content size does not reflect the number of lines despite our use of attributed text attributes to set line height. However, there is a work around to get the text view to render using the legacy TextKit 1 layout manager. Using the original layout manager the text view's have the expected intrinsic content size.馃搱 Coverage
Code
99.3% when testing iOS 15, 100% when testing iOS 16
(because there's a line of code that only runs on iOS 16)
Documentation
100%