Skip to content
Discussion options

You must be logged in to vote

Hi @wogus3602, unfortunately I don't think this is possible.

The problem is that RunLoop's conformance to the Scheduler protocol uses RunLoop.Mode.default, which is paused whenever there is user interaction. There doesn't seem to be any way to force a run loop scheduler to run in .common mode, which continues even when there is user interaction.

The only way to schedule a run loop timer in common mode is to use Timer.publisher, but then it will be a completely uncontrolled timer, and so will not be easy to test.

Unless others have ideas, I think you are stuck with using a DispatchQueue as your scheduler if you want the timer to continue during user interaction.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wogus3602
Comment options

Answer selected by wogus3602
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants