Replies: 2 comments 4 replies
-
Hi @pixlwave, something in Xcode/iOS must have changed this, but I don't think it's really a bug per se with the library. For these kinds of open ended questions I think discussions are better, so I am going to move this over to the discussions tab of the repo. Perhaps someone can help you figure it out over there! |
Beta Was this translation helpful? Give feedback.
1 reply
-
Ah ha, so it seems the fix is from the sizing method. Moving the frame from the view to a device layout fixes the issue: func testSnapshot() throws {
let view = CustomText_Previews.previews
assertSnapshot(of: view, as: .image(layout: .device(config: .iPhone13)))
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
Hi, I'm attempting to update our project from Xcode 15.2 to Xcode 15.4 and have hit a weird bug in our snapshot tests:
We have a custom SwiftUI text view that wraps a
UITextView
that's using the old TextKit 1 layout engine for various custom layout needs. With Xcode 15.4, when the height of this view exceeds a certain threshold (~5 lines of body text), then the text is no longer visible in any snapshots. All of our snapshots are generated from Xcode Previews which don't exhibit this behaviour so it appears to only be an issue with the snapshotting.Allowing the text view to use TextKit 2 by initialising with
usingTextLayoutManager: true
fixes the snapshots but sadly isn't a viable option for us at this time.To Reproduce
A minimal reproduction case looks like so:
Expected behavior
The snapshots should continue to render as they do when generated by Xcode 15.2.
Screenshots
Environment
Additional context
Sample Xcode project: TextKitSnapshots.zip
Beta Was this translation helpful? Give feedback.
All reactions