move logic to native

This commit is contained in:
王劲鹏
2020-01-04 14:43:28 +08:00
committed by osborn
parent 131ba87104
commit 8f0457101c
9 changed files with 157 additions and 30 deletions

View File

@@ -32,8 +32,12 @@ - (DoricStackView *)build {
- (void)onDrag:(UIPanGestureRecognizer *)gesture {
CGPoint point = [gesture translationInView:self.view];
CGRect originalFrame = self.view.frame;
originalFrame.origin.x += point.x;
originalFrame.origin.y += point.y;
self.view.frame = originalFrame;
[gesture setTranslation:CGPointZero inView:self.view];
[self callJSResponse:_onDragFunction, @(point.x), @(point.y), nil];
[self callJSResponse:_onDragFunction, @(originalFrame.origin.x), @(originalFrame.origin.y), nil];
}
- (void)blendView:(DoricStackView *)view forPropName:(NSString *)name propValue:(id)prop {