Merge pull request #3607 from dreampiggy/bugfix/watchOS_displayLink

Fix the SDDisplayLink on watchOS does not behave like other platform
This commit is contained in:
DreamPiggy 2023-09-21 23:04:12 +08:00 committed by GitHub
commit 5b14f51ae1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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];