iOS: fix non ui thread access view content offset
This commit is contained in:
parent
01b30f48bb
commit
761a6f67a4
@ -565,15 +565,16 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
if (!self.jsDispatcher) {
|
||||
self.jsDispatcher = [DoricJSDispatcher new];
|
||||
}
|
||||
|
||||
NSDictionary *offset = @{
|
||||
@"x": @(self.view.contentOffset.x),
|
||||
@"y": @(self.view.contentOffset.y),
|
||||
};
|
||||
|
||||
__weak typeof(self) __self = self;
|
||||
[self.jsDispatcher dispatch:^DoricAsyncResult * {
|
||||
__strong typeof(__self) self = __self;
|
||||
return [self callJSResponse:self.onScrollFuncId,
|
||||
@{
|
||||
@"x": @(self.view.contentOffset.x),
|
||||
@"y": @(self.view.contentOffset.y),
|
||||
},
|
||||
nil];
|
||||
return [self callJSResponse:self.onScrollFuncId, offset, nil];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
@ -471,15 +471,16 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
if (!self.jsDispatcher) {
|
||||
self.jsDispatcher = [DoricJSDispatcher new];
|
||||
}
|
||||
|
||||
NSDictionary *offset = @{
|
||||
@"x": @(self.view.contentOffset.x),
|
||||
@"y": @(self.view.contentOffset.y),
|
||||
};
|
||||
|
||||
__weak typeof(self) __self = self;
|
||||
[self.jsDispatcher dispatch:^DoricAsyncResult * {
|
||||
__strong typeof(__self) self = __self;
|
||||
return [self callJSResponse:self.onScrollFuncId,
|
||||
@{
|
||||
@"x": @(self.view.contentOffset.x),
|
||||
@"y": @(self.view.contentOffset.y),
|
||||
},
|
||||
nil];
|
||||
return [self callJSResponse:self.onScrollFuncId, offset, nil];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
@ -587,15 +587,16 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
if (!self.jsDispatcher) {
|
||||
self.jsDispatcher = [DoricJSDispatcher new];
|
||||
}
|
||||
|
||||
NSDictionary *offset = @{
|
||||
@"x": @(self.view.contentOffset.x),
|
||||
@"y": @(self.view.contentOffset.y),
|
||||
};
|
||||
|
||||
__weak typeof(self) __self = self;
|
||||
[self.jsDispatcher dispatch:^DoricAsyncResult * {
|
||||
__strong typeof(__self) self = __self;
|
||||
return [self callJSResponse:self.onScrollFuncId,
|
||||
@{
|
||||
@"x": @(self.view.contentOffset.x),
|
||||
@"y": @(self.view.contentOffset.y),
|
||||
},
|
||||
nil];
|
||||
return [self callJSResponse:self.onScrollFuncId, offset, nil];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
@ -136,15 +136,16 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
if (!self.jsDispatcher) {
|
||||
self.jsDispatcher = [DoricJSDispatcher new];
|
||||
}
|
||||
|
||||
NSDictionary *offset = @{
|
||||
@"x": @(self.view.contentOffset.x),
|
||||
@"y": @(self.view.contentOffset.y),
|
||||
};
|
||||
|
||||
__weak typeof(self) __self = self;
|
||||
[self.jsDispatcher dispatch:^DoricAsyncResult * {
|
||||
__strong typeof(__self) self = __self;
|
||||
return [self callJSResponse:self.onScrollFuncId,
|
||||
@{
|
||||
@"x": @(self.view.contentOffset.x),
|
||||
@"y": @(self.view.contentOffset.y),
|
||||
},
|
||||
nil];
|
||||
return [self callJSResponse:self.onScrollFuncId, offset, nil];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user