diff --git a/renderer/native/ios/renderer/HippyRootView.mm b/renderer/native/ios/renderer/HippyRootView.mm index ea2175dc00b..c525b65871f 100644 --- a/renderer/native/ios/renderer/HippyRootView.mm +++ b/renderer/native/ios/renderer/HippyRootView.mm @@ -321,6 +321,13 @@ - (void)setFrame:(CGRect)frame { } } +- (void)hippySetFrame:(CGRect)frame { + // Override hippySetFrame, + // to prevent an endless loop when synchronizing shadowView's frame to view. + // HippyRootContentView's frame is the source of truth, + // So we do nothing here. +} + #pragma mark - HippyComponent Method - (void)insertHippySubview:(UIView *)subview atIndex:(NSInteger)atIndex { diff --git a/renderer/native/ios/renderer/component/view/UIView+Hippy.mm b/renderer/native/ios/renderer/component/view/UIView+Hippy.mm index 48312d6bf6a..e4d5b08bc22 100644 --- a/renderer/native/ios/renderer/component/view/UIView+Hippy.mm +++ b/renderer/native/ios/renderer/component/view/UIView+Hippy.mm @@ -280,23 +280,6 @@ - (void)didUpdateHippySubviews { } - (void)hippySetFrame:(CGRect)frame { - // These frames are in terms of anchorPoint = topLeft, but internally the - // views are anchorPoint = center for easier scale and rotation animations. - // Convert the frame so it works with anchorPoint = center. - CGPoint position = { CGRectGetMidX(frame), CGRectGetMidY(frame) }; - CGRect bounds = { CGPointZero, frame.size }; - - // Avoid crashes due to nan coords - if (isnan(position.x) || isnan(position.y) || isnan(bounds.origin.x) || isnan(bounds.origin.y) || isnan(bounds.size.width) - || isnan(bounds.size.height)) { - HippyLogError( - @"Invalid layout for (%@)%@. position: %@. bounds: %@", self.hippyTag, self, NSStringFromCGPoint(position), NSStringFromCGRect(bounds)); - return; - } - - // self.center = position; - // self.bounds = bounds; - self.frame = frame; }