Skip to content

Commit

Permalink
fix(ios): increase code robustness and compatibility for HippyRootView
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Mar 12, 2024
1 parent 2400602 commit ace5988
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion renderer/native/ios/renderer/HippyRootView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ - (instancetype)initWithBridge:(HippyBridge *)bridge
// Execute loadInstance first and then do call back, maintain compatibility with hippy2
dispatch_async(dispatch_get_main_queue(), ^{
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (!strongSelf) {
return;
}
if (!error && !strongSelf.disableAutoRunApplication) {
[strongSelf runHippyApplication];
}
Expand Down Expand Up @@ -408,7 +411,7 @@ - (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex {
strongSelf->_contentHasAppeared = YES;
// int64_t cost = [strongSelf.bridge.performanceLogger durationForTag:HippyPLTTI];
[[NSNotificationCenter defaultCenter] postNotificationName:HippyContentDidAppearNotification
object:self userInfo:@{
object:self.superview userInfo:@{
// @"cost": @(cost)
}];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ typedef void (^HippyViewInsertionBlock)(UIView *container, NSArray<UIView *> *ch

/**
* Indicate how we create coresponding UIView
* HippyCreationTypeInstantly : create views instantly when NativeRenderObject is created
* HippyCreationTypeInstantly : create views instantly when HippyShadowView is created
* HippyCreationTypeLazily: create views when UIView is needed
*/
@property (nonatomic, assign) HippyCreationType creationType;
Expand Down

0 comments on commit ace5988

Please sign in to comment.