Skip to content

Commit 1713c0e

Browse files
authored
[WCiOS17] Address warnings from WordPressAuthenticator deprecations (#16391)
2 parents 07b8775 + d70d12c commit 1713c0e

File tree

8 files changed

+14
-430
lines changed

8 files changed

+14
-430
lines changed

WooCommerce/WooCommerce.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5734,9 +5734,7 @@
57345734
Logging/WPAuthenticatorLogging.h,
57355735
"NSURL+IDN/NSURL+IDN.h",
57365736
NUX/WPNUXMainButton.h,
5737-
NUX/WPNUXPrimaryButton.h,
57385737
NUX/WPNUXSecondaryButton.h,
5739-
NUX/WPWalkthroughOverlayView.h,
57405738
NUX/WPWalkthroughTextField.h,
57415739
Services/LoginFacade.h,
57425740
Services/WordPressXMLRPCAPIFacade.h,

WooCommerce/WordPressAuthenticator/Extensions/FancyAlertViewController+LoginError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ extension FancyAlertViewController {
184184
return FancyAlertViewController.controllerWithConfiguration(configuration: config)
185185
}
186186

187-
/// Shows a WPWalkthroughOverlayView for a bad url error message.
187+
/// Shows a view for a bad url error message.
188188
///
189189
/// - Parameter message: The error message to show.
190190
///

WooCommerce/WordPressAuthenticator/NUX/WPNUXPrimaryButton.h

Lines changed: 0 additions & 5 deletions
This file was deleted.

WooCommerce/WordPressAuthenticator/NUX/WPNUXPrimaryButton.m

Lines changed: 0 additions & 58 deletions
This file was deleted.

WooCommerce/WordPressAuthenticator/NUX/WPNUXSecondaryButton.m

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#import "WPNUXSecondaryButton.h"
2+
#import <UIKit/UIKit.h>
23
@import WordPressSharedObjC;
34

45

@@ -31,25 +32,34 @@ - (void)sizeToFit
3132

3233
// Adjust frame to account for the edge insets
3334
CGRect frame = self.frame;
34-
frame.size.width += self.titleEdgeInsets.left + self.titleEdgeInsets.right;
35+
frame.size.width += self.configuration.contentInsets.leading + self.configuration.contentInsets.trailing;
3536
self.frame = frame;
3637
}
3738

3839
- (CGSize)intrinsicContentSize
3940
{
4041
CGSize size = [self sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
41-
size.width += self.titleEdgeInsets.left + self.titleEdgeInsets.right;
42+
size.width += self.configuration.contentInsets.leading + self.configuration.contentInsets.trailing;
4243
return size;
4344
}
4445

4546
#pragma mark - Private Methods
4647

4748
- (void)configureButton
4849
{
50+
UIButtonConfiguration *config = [UIButtonConfiguration plainButtonConfiguration];
51+
config.contentInsets = NSDirectionalEdgeInsetsMake(
52+
WPNUXSecondaryButtonTitleEdgeInsets.top,
53+
WPNUXSecondaryButtonTitleEdgeInsets.left,
54+
WPNUXSecondaryButtonTitleEdgeInsets.bottom,
55+
WPNUXSecondaryButtonTitleEdgeInsets.right
56+
);
57+
self.configuration = config;
58+
4959
self.titleLabel.font = [WPFontManager systemRegularFontOfSize:15.0];
5060
self.titleLabel.minimumScaleFactor = 10.0/15.0;
5161
self.titleLabel.adjustsFontSizeToFitWidth = YES;
52-
[self setTitleEdgeInsets:WPNUXSecondaryButtonTitleEdgeInsets];
62+
5363
[self setTitleColor:[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
5464
[self setTitleColor:[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.4] forState:UIControlStateHighlighted];
5565
}

WooCommerce/WordPressAuthenticator/NUX/WPWalkthroughOverlayView.h

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)