Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit 4635a18

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents 1263e36 + 89616ef commit 4635a18

File tree

11 files changed

+65
-25
lines changed

11 files changed

+65
-25
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
source 'https://rubygems.org' do
2-
gem 'cocoapods', '1.6.1'
2+
gem 'cocoapods', '~>1.7.0'
33
gem 'cocoapods-repo-update'
44
end

Gemfile.lock

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.0)
4+
CFPropertyList (3.0.1)
55
activesupport (4.2.11.1)
66
i18n (~> 0.7)
77
minitest (~> 5.1)
88
thread_safe (~> 0.3, >= 0.3.4)
99
tzinfo (~> 1.1)
1010
atomos (0.1.3)
11-
claide (1.0.2)
12-
cocoapods (1.6.1)
11+
claide (1.0.3)
12+
cocoapods (1.7.5)
1313
activesupport (>= 4.0.2, < 5)
1414
claide (>= 1.0.2, < 2.0)
15-
cocoapods-core (= 1.6.1)
16-
cocoapods-deintegrate (>= 1.0.2, < 2.0)
15+
cocoapods-core (= 1.7.5)
16+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
1717
cocoapods-downloader (>= 1.2.2, < 2.0)
1818
cocoapods-plugins (>= 1.0.0, < 2.0)
1919
cocoapods-search (>= 1.0.0, < 2.0)
@@ -22,13 +22,13 @@ GEM
2222
cocoapods-try (>= 1.1.0, < 2.0)
2323
colored2 (~> 3.1)
2424
escape (~> 0.0.4)
25-
fourflusher (>= 2.2.0, < 3.0)
25+
fourflusher (>= 2.3.0, < 3.0)
2626
gh_inspector (~> 1.0)
2727
molinillo (~> 0.6.6)
2828
nap (~> 1.0)
2929
ruby-macho (~> 1.4)
30-
xcodeproj (>= 1.8.1, < 2.0)
31-
cocoapods-core (1.6.1)
30+
xcodeproj (>= 1.10.0, < 2.0)
31+
cocoapods-core (1.7.5)
3232
activesupport (>= 4.0.2, < 6)
3333
fuzzy_match (~> 2.0.4)
3434
nap (~> 1.0)
@@ -40,14 +40,14 @@ GEM
4040
cocoapods (~> 1.0, >= 1.3.0)
4141
cocoapods-search (1.0.0)
4242
cocoapods-stats (1.1.0)
43-
cocoapods-trunk (1.3.1)
43+
cocoapods-trunk (1.4.0)
4444
nap (>= 0.8, < 2.0)
4545
netrc (~> 0.11)
4646
cocoapods-try (1.1.0)
4747
colored2 (3.1.2)
4848
concurrent-ruby (1.1.5)
4949
escape (0.0.4)
50-
fourflusher (2.2.0)
50+
fourflusher (2.3.1)
5151
fuzzy_match (2.0.4)
5252
gh_inspector (1.1.3)
5353
i18n (0.9.5)
@@ -61,7 +61,7 @@ GEM
6161
thread_safe (0.3.6)
6262
tzinfo (1.2.5)
6363
thread_safe (~> 0.1)
64-
xcodeproj (1.8.2)
64+
xcodeproj (1.12.0)
6565
CFPropertyList (>= 2.3.3, < 4.0)
6666
atomos (~> 0.1.3)
6767
claide (>= 1.0.2, < 2.0)
@@ -72,7 +72,7 @@ PLATFORMS
7272
ruby
7373

7474
DEPENDENCIES
75-
cocoapods (= 1.6.1)!
75+
cocoapods (~> 1.7.0)!
7676
cocoapods-repo-update!
7777

7878
BUNDLED WITH

Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ SPEC CHECKSUMS:
124124

125125
PODFILE CHECKSUM: 066779a8741fbd6f8205a5d3469e19c8c80682b7
126126

127-
COCOAPODS: 1.6.1
127+
COCOAPODS: 1.7.5

WordPressAuthenticator.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WordPressAuthenticator"
3-
s.version = "1.8.0-beta.12"
3+
s.version = "1.8.0"
44
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."
55

66
s.description = <<-DESC
@@ -39,6 +39,6 @@ Pod::Spec.new do |s|
3939
s.dependency 'Gridicons', '~> 0.15'
4040
s.dependency 'GoogleSignIn', '~> 4.4'
4141
s.dependency 'WordPressUI', '~> 1.3'
42-
s.dependency 'WordPressKit', '~> 4.5.0-beta.2'
42+
s.dependency 'WordPressKit', '~> 4.5.0'
4343
s.dependency 'WordPressShared', '~> 1.8'
4444
end

WordPressAuthenticator.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -715,15 +715,11 @@
715715
buildActionMask = 2147483647;
716716
files = (
717717
);
718-
inputFileListPaths = (
719-
);
720718
inputPaths = (
721719
"${PODS_ROOT}/Target Support Files/Pods-WordPressAuthenticatorTests/Pods-WordPressAuthenticatorTests-resources.sh",
722720
"${PODS_ROOT}/GoogleSignIn/Resources/GoogleSignIn.bundle",
723721
);
724722
name = "[CP] Copy Pods Resources";
725-
outputFileListPaths = (
726-
);
727723
outputPaths = (
728724
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleSignIn.bundle",
729725
);

WordPressAuthenticator/Extensions/WPStyleGuide+Login.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,15 @@ extension WPStyleGuide {
190190
/// - Returns: A properly styled UIButton
191191
///
192192
class func termsButton() -> UIButton {
193+
let style = WordPressAuthenticator.shared.style
194+
193195
let baseString = NSLocalizedString("By signing up, you agree to our _Terms of Service_.", comment: "Legal disclaimer for signup buttons, the underscores _..._ denote underline")
194196

195-
let labelString = baseString.underlined()
197+
let attrStrNormal = baseString.underlined(color: style.subheadlineColor, underlineColor: style.textButtonColor)
198+
let attrStrHighlight = baseString.underlined(color: style.subheadlineColor, underlineColor: style.textButtonHighlightColor)
199+
let font = WPStyleGuide.mediumWeightFont(forStyle: .footnote)
196200

197-
let font = WPStyleGuide.mediumWeightFont(forStyle: .caption2)
198-
return textButton(normal: labelString, highlighted: labelString, font: font, alignment: .center)
201+
return textButton(normal: attrStrNormal, highlighted: attrStrHighlight, font: font, alignment: .center)
199202
}
200203

201204
private class func textButton(normal normalString: NSAttributedString, highlighted highlightString: NSAttributedString, font: UIFont, alignment: UIControl.NaturalContentHorizontalAlignment = .leading) -> UIButton {

WordPressAuthenticator/NUX/NUXButton.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import WordPressUI
1010

1111
@objc let activityIndicator: UIActivityIndicatorView = {
1212
let indicator = UIActivityIndicatorView(style: .white)
13+
indicator.color = WordPressAuthenticator.shared.style.primaryTitleColor
1314
indicator.hidesWhenStopped = true
1415
return indicator
1516
}()

WordPressAuthenticator/Signin/LoginEmailViewController.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,9 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder {
453453
vc.googleTapped = { [weak self] in
454454
self?.performSegue(withIdentifier: NUXViewController.SegueIdentifier.showGoogle.rawValue, sender: self)
455455
}
456+
vc.appleTapped = { [weak self] in
457+
self?.appleTapped()
458+
}
456459
vc.modalPresentationStyle = .custom
457460
}
458461
}
@@ -540,6 +543,13 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder {
540543
}
541544
}
542545
}
546+
547+
private func appleTapped() {
548+
#if XCODE11
549+
AppleAuthenticator.sharedInstance.delegate = self
550+
AppleAuthenticator.sharedInstance.showFrom(viewController: self)
551+
#endif
552+
}
543553
}
544554

545555
// LoginFacadeDelegate methods for Google Google Sign In
@@ -626,3 +636,12 @@ extension LoginEmailViewController: LoginSocialErrorViewControllerDelegate {
626636
/// This is needed to set self as uiDelegate, even though none of the methods are called
627637
extension LoginEmailViewController: GIDSignInUIDelegate {
628638
}
639+
640+
#if XCODE11
641+
extension LoginEmailViewController: AppleAuthenticatorDelegate {
642+
func showWPComLogin(loginFields: LoginFields) {
643+
self.loginFields = loginFields
644+
performSegue(withIdentifier: .showWPComLogin, sender: self)
645+
}
646+
}
647+
#endif

WordPressAuthenticator/Signin/LoginPrologueSignupMethodViewController.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class LoginPrologueSignupMethodViewController: NUXViewController {
1212

1313
open var emailTapped: (() -> Void)?
1414
open var googleTapped: (() -> Void)?
15+
open var appleTapped: (() -> Void)?
1516

1617
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
1718
super.prepare(for: segue, sender: sender)
@@ -68,11 +69,27 @@ class LoginPrologueSignupMethodViewController: NUXViewController {
6869
self?.present(safariViewController, animated: true, completion: nil)
6970
}
7071
buttonViewController.stackView?.insertArrangedSubview(termsButton, at: 0)
72+
73+
if WordPressAuthenticator.shared.configuration.enableSignInWithApple {
74+
#if XCODE11
75+
if #available(iOS 13.0, *) {
76+
let appleButton = WPStyleGuide.appleLoginButton()
77+
appleButton.addTarget(self, action: #selector(handleAppleButtonTapped), for: .touchDown)
78+
buttonViewController.stackView?.insertArrangedSubview(appleButton, at: 1)
79+
}
80+
#endif
81+
}
82+
7183
buttonViewController.backgroundColor = WordPressAuthenticator.shared.style.viewControllerBackgroundColor
7284
}
7385

7486
@IBAction func dismissTapped() {
7587
WordPressAuthenticator.track(.signupCancelled)
7688
dismiss(animated: true)
7789
}
90+
91+
@objc func handleAppleButtonTapped() {
92+
dismiss(animated: true)
93+
appleTapped?()
94+
}
7895
}

WordPressAuthenticator/Signin/LoginPrologueViewController.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ class LoginPrologueViewController: LoginViewController {
5151
vc.googleTapped = { [weak self] in
5252
self?.performSegue(withIdentifier: .showGoogle, sender: self)
5353
}
54+
vc.appleTapped = { [weak self] in
55+
self?.appleTapped()
56+
}
5457
vc.modalPresentationStyle = .custom
5558
}
5659

0 commit comments

Comments
 (0)