CADisplayLink() constructor
The CADisplayLink() constructor creates a timer synchronized with screen refreshes. It doesn't start on its own after creation.
Syntax
new CADisplayLink()Parameters
None.
Return value
A new CADisplayLink. It starts firing only after you both listen for tick and call addToRunLoop(). Before it starts, timestamp and duration are 0.
Examples
js
const link = new CADisplayLink();
console.log(link.isPaused, link.timestamp);Result: logs false 0 to the console.
Corresponding iOS API
+[CADisplayLink displayLinkWithTarget:selector:]. There is no target or selector; add the callback with addEventListener('tick', …).