Support `shadowView.rootView`
Reviewed By: shergin Differential Revision: D5418509 fbshipit-source-id: 585b088678096ccf8416ea21a675d8953bfa82c8
This commit is contained in:
parent
a3142f50ed
commit
5701ae2145
|
@ -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
|
Loading…
Reference in New Issue