Skip to content

Conversation

@stephencelis
Copy link
Member

We've been using DispatchQueue's setSpecific and getSpecific to detect the main queue, but this doesn't seem to work in watchOS (or maybe I've been holding it wrong). I think in our case we really only care if we're on the main thread, so I'm hoping a Thread.isMainThread is enough.

If this fix is appropriate we should apply it to other repos that rely on this, as well, like SnapshotTesting.

Fixes #120

We've been using `DispatchQueue`'s `setSpecific` and `getSpecific` to
detect the main queue, but this doesn't seem to work in watchOS (or
maybe I've been holding it wrong). I think in our case we really only
care if we're on the main thread, so I'm hoping a `Thread.isMainThread`
is enough.

If this fix is appropriate we should apply it to other repos that rely
on this, as well, like SnapshotTesting.

Fixes #120
@stephencelis stephencelis merged commit 4602cab into main Oct 2, 2023
@stephencelis stephencelis deleted the fix-watchos-main-queue branch October 2, 2023 22:14
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.

Crash when testing a watchOS app target with a WKApplicationDelegateAdaptor that uses a dependency

3 participants