Skip to content

Commit

Permalink
Add check to make sure private property exists before modifying (othe…
Browse files Browse the repository at this point in the history
…rwise program crashes) (#698)
  • Loading branch information
NSAntoine authored Jun 7, 2024
1 parent 299b03d commit 060b11f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Natives/customcontrols/ControlLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ - (void)setFrame:(CGRect)frame {

// https://nsantoine.dev/posts/CALayerCaptureHiding
- (void)hideViewFromCapture:(BOOL)hide {
NSUInteger hideFlag = (1 << 1) | (1 << 4);
self.layer.disableUpdateMask = hide ? hideFlag : 0;
if ([self.layer respondsToSelector:@selector(disableUpdateMask)]) {
NSUInteger hideFlag = (1 << 1) | (1 << 4);
self.layer.disableUpdateMask = hide ? hideFlag : 0;
}
}

@end

0 comments on commit 060b11f

Please sign in to comment.