You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by doumafang <gi...@git.apache.org> on 2018/03/29 06:47:33 UTC

[GitHub] incubator-weex pull request #1093: [WEEX-113] [iOS] New Touch Dispatch Mecha...

GitHub user doumafang opened a pull request:

    https://github.com/apache/incubator-weex/pull/1093

    [WEEX-113] [iOS] New Touch Dispatch Mechanism And Bubble Sync Method

    Now iOS support new events dispatch by stopPropagation. You can use @stopPropagation to decide if touch event or other advanced gesture events to pass down.
    
    You can try this feature by http://dotwe.org/vue/10a573183dfe3ba172c818e6d285f729 
    or http://dotwe.org/vue/359e12259ab86d410cb32cda9264e62c.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/doumafang/incubator-weex master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-weex/pull/1093.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1093
    
----
commit a8427ff31d033901796a9a8ee1aff39b5eb3d63c
Author: doumafang <do...@...>
Date:   2018-03-29T06:45:39Z

    [WEEX-113] [iOS] New Touch Dispatch Mechanism And Bubble Sync Method
    
    Now iOS support new events dispatch by stopPropagation. You can use @stopPropagation to decide if touch event or other advanced gesture events to pass down.
    
    You can try this feature by http://dotwe.org/vue/10a573183dfe3ba172c818e6d285f729 or http://dotwe.org/vue/359e12259ab86d410cb32cda9264e62c.

----


---

[GitHub] incubator-weex pull request #1093: [WEEX-113] [iOS] New Touch Dispatch Mecha...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-weex/pull/1093


---

[GitHub] incubator-weex issue #1093: [WEEX-113] [iOS] New Touch Dispatch Mechanism An...

Posted by doumafang <gi...@git.apache.org>.
Github user doumafang commented on the issue:

    https://github.com/apache/incubator-weex/pull/1093
  
    [WEEX-113] [iOS] New Touch Dispatch Mechanism And Bubble Sync Method


---

[GitHub] incubator-weex issue #1093: [WEEX-113] [iOS] New Touch Dispatch Mechanism An...

Posted by weex-bot <gi...@git.apache.org>.
Github user weex-bot commented on the issue:

    https://github.com/apache/incubator-weex/pull/1093
  
    
    <!--
      0 failure: 
      1 warning:  No Changelog chan...
      1 messages
      
    -->
    
    
    <table>
      <thead>
        <tr>
          <th width="50"></th>
          <th width="100%" data-danger-table="true">Warnings</th>
        </tr>
      </thead>
      <tbody><tr>
          <td>:warning:</td>
          <td>No Changelog changes!</td>
        </tr>
      </tbody>
    </table>
    
    
    <table>
      <thead>
        <tr>
          <th width="50"></th>
          <th width="100%" data-danger-table="true">Messages</th>
        </tr>
      </thead>
      <tbody><tr>
          <td>:book:</td>
          <td>danger test finished.</td>
        </tr>
      </tbody>
    </table>
    
    
    <p align="right">
      Generated by :no_entry_sign: <a href="http://github.com/danger/danger-js/">dangerJS</a>
    </p>



---

[GitHub] incubator-weex pull request #1093: [WEEX-113] [iOS] New Touch Dispatch Mecha...

Posted by acton393 <gi...@git.apache.org>.
Github user acton393 commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/1093#discussion_r177976635
  
    --- Diff: ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m ---
    @@ -584,6 +583,12 @@ - (void)callJSMethod:(NSString *)method args:(NSArray *)args onContext:(JSContex
         }
     }
     
    +- (JSValue *)excuteJsMethodWithResult:(WXCallJSMethod *)method
    --- End diff --
    
    `executeJSMethod...` maybe  `JS` should be capital


---

[GitHub] incubator-weex pull request #1093: [WEEX-113] [iOS] New Touch Dispatch Mecha...

Posted by acton393 <gi...@git.apache.org>.
Github user acton393 commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/1093#discussion_r177977039
  
    --- Diff: ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m ---
    @@ -35,6 +35,35 @@ @interface WXScrollerComponnetView:UIScrollView
     @implementation WXScrollerComponnetView
     @end
     
    +@interface UIScrollView (Events)
    --- End diff --
    
    I think that the name of Events category for UIScrollview  is not long enough avoiding conflict later.


---

[GitHub] incubator-weex pull request #1093: [WEEX-113] [iOS] New Touch Dispatch Mecha...

Posted by acton393 <gi...@git.apache.org>.
Github user acton393 commented on a diff in the pull request:

    https://github.com/apache/incubator-weex/pull/1093#discussion_r177999835
  
    --- Diff: ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m ---
    @@ -698,10 +732,41 @@ - (void)checkRemoveTouchGesture
         }
     }
     
    -#pragma mark - UIGestureRecognizerDelegate
    +- (void)gestureShouldStopPropagation:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
    +{
    +    NSString *ref = _templateComponent ? _templateComponent.ref : self.ref;
    +    CGPoint screenLocation = [touch locationInView:touch.window];
    +    CGPoint pageLocation = [touch locationInView:self.weexInstance.rootView];
    +    NSDictionary *resultTouch = [self touchResultWithScreenLocation:screenLocation pageLocation:pageLocation identifier:touch.wx_identifier];
    +    NSString *touchState;
    +    if (touch.phase == UITouchPhaseBegan) {
    +        touchState = @"start";
    +    }
    +    else if (touch.phase == UITouchPhaseMoved){
    +        touchState = @"move";
    +    }
    +    else{
    +        touchState = @"end";
    +    }
    +    BOOL stopPropagation = [[WXEventManager sharedManager]stopPropagation:self.weexInstance.instanceId ref:ref type:@"stopPropagation" params:@{@"changedTouches":resultTouch ? @[resultTouch] : @[],@"action":touchState}];
    +    touch.wx_stopPropagation = stopPropagation ? @1 : @0;
    +}
     
    +#pragma mark - UIGestureRecognizerDelegate
     - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
     {
    +    CGPoint screenLocation = [touch locationInView:touch.window];
    +    NSLog(@"%@",NSStringFromCGPoint(screenLocation));
    --- End diff --
    
    NSLog is not recommended here, you can use  WXLog combined with its loglevel 


---