-
Describe the bug Is there a way to convert To Reproduce// And/or enter code that reproduces the behavior here.
private let mainLoop: AnySchedulerOf<RunLoop>
let displayLink = CADisplayLink(target: self, selector: #selector(update))
displayLink.add(to: self.mainLoop, forMode: .default) // <- Error Above Expected behaviorEnvironment
Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @nsoojin, unfortunately this is not possible and for good reason. If you have an instance of However, one of the main reasons one uses You can see the same problem with If you share some details how you plan on using You may also be interested in this similar discussion: #36 Also I'm going to convert this issue to a discussion since it's not a bug with the library. |
Beta Was this translation helpful? Give feedback.
-
I think your only option for making that code testable is to design a dependency wrapper so that you can hide the |
Beta Was this translation helpful? Give feedback.
I think your only option for making that code testable is to design a dependency wrapper so that you can hide the
CADisplayLink
. Then the live version of the dependency can useCADisplayLink
and the mock/test-friendly version can just use a plain timer that works with schedulers.