Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix iOS 16 UITextView intrinsicContentSize bug #12

Merged
merged 1 commit into from
Aug 18, 2022

Conversation

mpospese
Copy link
Contributor

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

  • iOS 16-only change to TypographyTextView
  • slight change to a unit test

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)

image

Documentation

100%

image

@mpospese mpospese merged commit 781ff36 into main Aug 18, 2022
@mpospese mpospese deleted the bugfix/CM-828-Xcode14b4-fix branch August 18, 2022 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants