Skip to content
This repository was archived by the owner on Nov 23, 2020. It is now read-only.

Commit d602808

Browse files
committed
fix sourceViewNativeID bad access
1 parent 99e2415 commit d602808

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

ios/RNPopoverHostView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
/**
4949
nativeID for the native view containing the anchor rectangle for the popover.
5050
*/
51-
@property (nonatomic, assign) NSString *sourceViewNativeID;
51+
@property (nonatomic, strong) NSString *sourceViewNativeID;
5252

5353
/**
5454
reactTag for the react view containing the anchor rectangle for the popover.

ios/RNPopoverHostView.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ - (void)didMoveToWindow {
100100
if (!_initialized && self.window) {
101101
_initialized = YES;
102102
_popoverHostViewController.view.backgroundColor = _popoverBackgroundColor;
103-
104103
[self autoGetSourceView:^(UIView *sourceView) {
105104
if (!sourceView) {
106105
NSLog(@"sourceView is invalid");

ios/RNPopoverHostViewController.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ - (instancetype)init {
2323
}
2424

2525
- (void)viewDidLoad {
26-
27-
2826
[super viewDidLoad];
2927
}
3028

@@ -33,4 +31,5 @@ - (void)didReceiveMemoryWarning {
3331
// Dispose of any resources that can be recreated.
3432
}
3533

34+
3635
@end

ios/RNPopoverHostViewManager.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ - (void)presentPopoverHostView:(RNPopoverHostView *_Nullable)popoverHostView wit
9292
}
9393
};
9494

95-
[[self topViewController] presentViewController:viewController animated:animated completion:completionBlock];
95+
[[popoverHostView reactViewController] presentViewController:viewController animated:animated completion:completionBlock];
9696
}
9797

9898
- (void)dismissPopoverHostView:(RNPopoverHostView *_Nullable)popoverHostView withViewController:(RNPopoverHostViewController *_Nullable)viewController animated:(BOOL)animated {

0 commit comments

Comments
 (0)