diff --git a/Signal/src/util/OWSScreenLockUI.m b/Signal/src/util/OWSScreenLockUI.m index 2f91d51f6..6b166440d 100644 --- a/Signal/src/util/OWSScreenLockUI.m +++ b/Signal/src/util/OWSScreenLockUI.m @@ -514,10 +514,6 @@ const UIWindowLevel UIWindowLevel_Background = -1.f; UIView *rootView = self.screenBlockingViewController.view; - [NSLayoutConstraint deactivateConstraints:self.screenBlockingConstraints]; - - NSMutableArray *screenBlockingConstraints = [NSMutableArray new]; - BOOL shouldHaveScreenLock = desiredUIState == ScreenLockUIStateScreenLock; NSString *signature = [NSString stringWithFormat:@"%d %d", shouldHaveScreenLock, self.isShowingScreenLockUI]; if ([NSObject isNullableObject:self.screenBlockingSignature equalTo:signature]) { @@ -525,6 +521,10 @@ const UIWindowLevel UIWindowLevel_Background = -1.f; return; } + [NSLayoutConstraint deactivateConstraints:self.screenBlockingConstraints]; + + NSMutableArray *screenBlockingConstraints = [NSMutableArray new]; + self.screenBlockingButton.hidden = !shouldHaveScreenLock; if (self.isShowingScreenLockUI) { diff --git a/SignalMessaging/categories/UIView+OWS.h b/SignalMessaging/categories/UIView+OWS.h index 1c28b1286..165f60ca0 100644 --- a/SignalMessaging/categories/UIView+OWS.h +++ b/SignalMessaging/categories/UIView+OWS.h @@ -118,6 +118,8 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value); - (void)addRedBorderRecursively; #ifdef DEBUG +- (void)logFrame; +- (void)logFrameWithLabel:(NSString *)label; - (void)logFrameLater; - (void)logFrameLaterWithLabel:(NSString *)label; - (void)logHierarchyUpwardLaterWithLabel:(NSString *)label; diff --git a/SignalMessaging/categories/UIView+OWS.m b/SignalMessaging/categories/UIView+OWS.m index 867066c3c..a31942e27 100644 --- a/SignalMessaging/categories/UIView+OWS.m +++ b/SignalMessaging/categories/UIView+OWS.m @@ -452,6 +452,21 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value) } } +- (void)logFrame +{ + [self logFrameWithLabel:@""]; +} + +- (void)logFrameWithLabel:(NSString *)label +{ + DDLogVerbose(@"%@ %@ frame: %@, hidden: %d, opacity: %f", + self.logTag, + label, + NSStringFromCGRect(self.frame), + self.hidden, + self.layer.opacity); +} + - (void)logFrameLater { [self logFrameLaterWithLabel:@""]; @@ -460,12 +475,7 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value) - (void)logFrameLaterWithLabel:(NSString *)label { dispatch_async(dispatch_get_main_queue(), ^{ - DDLogVerbose(@"%@ %@ frame: %@, hidden: %d, opacity: %f", - self.logTag, - label, - NSStringFromCGRect(self.frame), - self.hidden, - self.layer.opacity); + [self logFrameWithLabel:label]; }); }