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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide text field and text view cursors while snapshotting #206

Merged
merged 1 commit into from Feb 17, 2024

Conversation

NickEntin
Copy link
Collaborator

Resolves #15

@DavidBrunow
Copy link
Contributor

You may have already considered and rejected this idea, but I've used UITextField.appearance().tintColor = .clear in the past to globally hide the cursors while creating snapshots.

@NickEntin
Copy link
Collaborator Author

NickEntin commented Feb 13, 2024

You may have already considered and rejected this idea, but I've used UITextField.appearance().tintColor = .clear in the past to globally hide the cursors while creating snapshots.

@DavidBrunow Great suggestion, but I don't think there's a way to restore the original tint colors after the snapshot using the appearance API. If there's a way I don't know about, I'd love to hear.

@NickEntin
Copy link
Collaborator Author

Hmm the iOS 16 build is failing due to missing activation point targets. I've seen this issue locally too, but can't figure out what causes it. Sometimes the image just doesn't load.

	ActivationPointTests.testActivationPointEnabled()
	ActivationPointTests.testActivationPointEnabledWhenOverridden()
	-[ImpreciseObjectiveCTests testSimpleViewWithActivationPointAlways]
	-[ObjectiveCTests testSimpleViewWithActivationPointAlways]
	-[ObjectiveCTests testSimpleViewWithActivationPointDefault]
	SnapshotTestingTests.testShowingActivationPoint()
	SnapshotTestingTests.testShowingActivationPoint()

@NickEntin
Copy link
Collaborator Author

Filed #208 to track the activation point issue.

@NickEntin NickEntin marked this pull request as ready for review February 16, 2024 23:21
@NickEntin NickEntin merged commit d14725f into master Feb 17, 2024
9 checks passed
@NickEntin NickEntin deleted the entin/text-field-cursor branch February 17, 2024 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve support for snapshotting views with text field cursors to prevent tests from flaking
3 participants