Permalink
Browse files

Support `shadowView.rootView`

Reviewed By: shergin

Differential Revision: D5418509

fbshipit-source-id: 585b088678096ccf8416ea21a675d8953bfa82c8
  • Loading branch information...
Yu-w authored and facebook-github-bot committed Jul 15, 2017
1 parent a3142f5 commit 5701ae2145c7af4fa86b5a82f5883e62af7a61f0
Showing with 39 additions and 0 deletions.
  1. +16 −0 React/Views/RCTShadowView+Hierarchy.h
  2. +23 −0 React/Views/RCTShadowView+Hierarchy.m
@@ -0,0 +1,16 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <React/RCTRootShadowView.h>
#import <React/RCTShadowView.h>
@interface RCTShadowView (Hierarchy)
@property (nonatomic, readonly) RCTRootShadowView *rootView;
@end
@@ -0,0 +1,23 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "RCTShadowView+Hierarchy.h"
@implementation RCTShadowView (Hierarchy)
- (nullable RCTRootShadowView *)rootView
{
RCTShadowView *view = self;
while (view != nil && ![view isKindOfClass:[RCTRootShadowView class]]) {
view = view.superview;
}
return (RCTRootShadowView *)view;
}
@end

0 comments on commit 5701ae2

Please sign in to comment.