Fix the SDDisplayLink on watchOS does not behave like other platform

The first callback should be trigger in next runloop when calling `start`, not callback in sync
This commit is contained in:
DreamPiggy 2023-09-21 22:36:08 +08:00
parent 6e844d1967
commit 0b8e0f68d3
1 changed files with 1 additions and 1 deletions

View File

@ -197,7 +197,7 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
self.displayLink.paused = NO; self.displayLink.paused = NO;
#else #else
if (self.displayLink.isValid) { if (self.displayLink.isValid) {
[self.displayLink fire]; // Do nothing
} else { } else {
SDWeakProxy *weakProxy = [SDWeakProxy proxyWithTarget:self]; SDWeakProxy *weakProxy = [SDWeakProxy proxyWithTarget:self];
self.displayLink = [NSTimer timerWithTimeInterval:kSDDisplayLinkInterval target:weakProxy selector:@selector(displayLinkDidRefresh:) userInfo:nil repeats:YES]; self.displayLink = [NSTimer timerWithTimeInterval:kSDDisplayLinkInterval target:weakProxy selector:@selector(displayLinkDidRefresh:) userInfo:nil repeats:YES];