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:
parent
6e844d1967
commit
0b8e0f68d3
|
@ -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];
|
||||||
|
|
Loading…
Reference in New Issue