From 845c286b43382ec93d72a8dd79f0e6175fa1eac7 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Tue, 1 Aug 2017 14:29:02 -0400 Subject: [PATCH 1/3] bump version // FREEBIE --- Signal/Signal-Info.plist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index ee1157851..8b0394c41 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -38,7 +38,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.15.0 + 2.15.1 CFBundleSignature ???? CFBundleURLTypes @@ -55,7 +55,7 @@ CFBundleVersion - 2.15.0.4 + 2.15.1.0 ITSAppUsesNonExemptEncryption LOGS_EMAIL From 249a3fcabc59b71ba60993bdafbaa6b0e50dc7d5 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Tue, 1 Aug 2017 14:17:09 -0400 Subject: [PATCH 2/3] Show proper setting for CallKitPrivacy // FREEBIE --- Signal/src/ViewControllers/PrivacySettingsTableViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/PrivacySettingsTableViewController.m b/Signal/src/ViewControllers/PrivacySettingsTableViewController.m index d1b8e1836..5ae04bd71 100644 --- a/Signal/src/ViewControllers/PrivacySettingsTableViewController.m +++ b/Signal/src/ViewControllers/PrivacySettingsTableViewController.m @@ -81,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN [callKitSection addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_CALLKIT_PRIVACY_TITLE", @"Label for 'CallKit privacy' preference") - isOn:[Environment.preferences isCallKitPrivacyEnabled] + isOn:![Environment.preferences isCallKitPrivacyEnabled] target:weakSelf selector:@selector(didToggleEnableCallKitPrivacySwitch:)]]; } From 99c948568be5b2271dbbd336a4797ddf84ab2e03 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 1 Aug 2017 14:49:39 -0400 Subject: [PATCH 3/3] Remove iOS 9-only APIs from layout code. // FREEBIE --- Signal/src/UIView+OWS.m | 71 ++++++++++++++----- .../RegistrationViewController.m | 2 - 2 files changed, 52 insertions(+), 21 deletions(-) diff --git a/Signal/src/UIView+OWS.m b/Signal/src/UIView+OWS.m index 206189177..14c8230ff 100644 --- a/Signal/src/UIView+OWS.m +++ b/Signal/src/UIView+OWS.m @@ -217,8 +217,13 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value) - (BOOL)isRTL { - return ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute] - == UIUserInterfaceLayoutDirectionRightToLeft); + if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { + return ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute] + == UIUserInterfaceLayoutDirectionRightToLeft); + } else { + return + [UIApplication sharedApplication].userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft; + } } - (NSLayoutConstraint *)autoPinLeadingToSuperView @@ -228,10 +233,16 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value) - (NSLayoutConstraint *)autoPinLeadingToSuperViewWithMargin:(CGFloat)margin { - NSLayoutConstraint *constraint = - [self.leadingAnchor constraintEqualToAnchor:self.superview.layoutMarginsGuide.leadingAnchor constant:margin]; - constraint.active = YES; - return constraint; + if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { + NSLayoutConstraint *constraint = + [self.leadingAnchor constraintEqualToAnchor:self.superview.layoutMarginsGuide.leadingAnchor + constant:margin]; + constraint.active = YES; + return constraint; + } else { + margin += (self.isRTL ? self.superview.layoutMargins.right : self.superview.layoutMargins.left); + return [self autoPinEdgeToSuperviewEdge:ALEdgeLeading withInset:margin]; + } } - (NSLayoutConstraint *)autoPinTrailingToSuperView @@ -241,10 +252,17 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value) - (NSLayoutConstraint *)autoPinTrailingToSuperViewWithMargin:(CGFloat)margin { - NSLayoutConstraint *constraint = - [self.trailingAnchor constraintEqualToAnchor:self.superview.layoutMarginsGuide.trailingAnchor constant:-margin]; - constraint.active = YES; - return constraint; + if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { + NSLayoutConstraint *constraint = + [self.trailingAnchor constraintEqualToAnchor:self.superview.layoutMarginsGuide.trailingAnchor + constant:-margin]; + constraint.active = YES; + return constraint; + } else { + CGFloat oldMargin = margin; + margin += (self.isRTL ? self.superview.layoutMargins.left : self.superview.layoutMargins.right); + return [self autoPinEdgeToSuperviewEdge:ALEdgeTrailing withInset:margin]; + } } - (NSLayoutConstraint *)autoPinLeadingToTrailingOfView:(UIView *)view @@ -258,9 +276,14 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value) { OWSAssert(view); - NSLayoutConstraint *constraint = [self.leadingAnchor constraintEqualToAnchor:view.trailingAnchor constant:margin]; - constraint.active = YES; - return constraint; + if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { + NSLayoutConstraint *constraint = + [self.leadingAnchor constraintEqualToAnchor:view.trailingAnchor constant:margin]; + constraint.active = YES; + return constraint; + } else { + return [self autoPinEdge:ALEdgeLeading toEdge:ALEdgeTrailing ofView:view withOffset:margin]; + } } - (NSLayoutConstraint *)autoPinLeadingToView:(UIView *)view @@ -274,9 +297,14 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value) { OWSAssert(view); - NSLayoutConstraint *constraint = [self.leadingAnchor constraintEqualToAnchor:view.leadingAnchor constant:margin]; - constraint.active = YES; - return constraint; + if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { + NSLayoutConstraint *constraint = + [self.leadingAnchor constraintEqualToAnchor:view.leadingAnchor constant:margin]; + constraint.active = YES; + return constraint; + } else { + return [self autoPinEdge:ALEdgeLeading toEdge:ALEdgeLeading ofView:view withOffset:margin]; + } } - (NSLayoutConstraint *)autoPinTrailingToView:(UIView *)view @@ -290,9 +318,14 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value) { OWSAssert(view); - NSLayoutConstraint *constraint = [self.trailingAnchor constraintEqualToAnchor:view.trailingAnchor constant:margin]; - constraint.active = YES; - return constraint; + if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(9, 0)) { + NSLayoutConstraint *constraint = + [self.trailingAnchor constraintEqualToAnchor:view.trailingAnchor constant:margin]; + constraint.active = YES; + return constraint; + } else { + return [self autoPinEdge:ALEdgeTrailing toEdge:ALEdgeTrailing ofView:view withOffset:margin]; + } } - (NSTextAlignment)textAlignmentUnnatural diff --git a/Signal/src/ViewControllers/RegistrationViewController.m b/Signal/src/ViewControllers/RegistrationViewController.m index 3258522e9..230955acc 100644 --- a/Signal/src/ViewControllers/RegistrationViewController.m +++ b/Signal/src/ViewControllers/RegistrationViewController.m @@ -112,7 +112,6 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi // Country UIView *countryRow = [UIView containerView]; - countryRow.preservesSuperviewLayoutMargins = YES; [contentView addSubview:countryRow]; [countryRow autoPinLeadingAndTrailingToSuperview]; [countryRow autoPinEdgeToSuperviewEdge:ALEdgeTop]; @@ -147,7 +146,6 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi // Phone Number UIView *phoneNumberRow = [UIView containerView]; - phoneNumberRow.preservesSuperviewLayoutMargins = YES; [contentView addSubview:phoneNumberRow]; [phoneNumberRow autoPinLeadingAndTrailingToSuperview]; [phoneNumberRow autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:separatorView1];