-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add DisplayLinkClock for iOS, tvOS, and macOS #170
Add DisplayLinkClock for iOS, tvOS, and macOS #170
Conversation
molecule-runtime/src/macosMain/kotlin/app/cash/molecule/DisplayLinkClock.kt
Show resolved
Hide resolved
molecule-runtime/src/quartzCoreMain/kotlin/app/cash/molecule/DisplayLinkClock.kt
Show resolved
Hide resolved
molecule-runtime/src/quartzCoreMain/kotlin/app/cash/molecule/DisplayLinkClock.kt
Show resolved
Hide resolved
molecule-runtime/src/quartzCoreMain/kotlin/app/cash/molecule/DisplayLinkClock.kt
Outdated
Show resolved
Hide resolved
067aa76
to
a7aa8f4
Compare
@JakeWharton this PR is ready for a real review now. One thing to note -- The current |
To anyone watching this from the outside (because I keep linking it to people), we are going to merge, but are in the process of adding unit tests for iOS and tvOS. |
FYI, I borrowed some of this for Redwood. |
private val displayLink: CADisplayLink = CADisplayLink.displayLinkWithTarget( | ||
target = this, | ||
selector = NSSelectorFromString(this::tickClock.name), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm looking at this again months later and this doesn't need a variable. It can just be in an init
block 🤦
This commit adds two imlementations of a `MonotonicFrameClock` backed by `CADisplayLink` on iOS and tvOS and `CVDisplayLink` on macOS. watchOS does not have an equivalent that I'm aware of and therefore has been omitted.
fb72f01
to
76d653e
Compare
76d653e
to
14390c0
Compare
Woohoo! Thanks for getting this over the finish line, Jake. |
This commit adds two imlementations of a
MonotonicFrameClock
backed by
CADisplayLink
on iOS and tvOS andCVDisplayLink
on macOS.
watchOS does not have an equivalent that I'm aware of and therefore
has been omitted.