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

Commit 1b820b6

Browse files
authored
Merge pull request #225 from wordpress-mobile/issue/224-remove-showSignupMethod
UL&S: Remove `.showSignupMethod`
2 parents 5867587 + ac47309 commit 1b820b6

File tree

5 files changed

+47
-32
lines changed

5 files changed

+47
-32
lines changed

WordPressAuthenticator.podspec

Lines changed: 1 addition & 1 deletion
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.12.0-beta.5"
3+
s.version = "1.12.0-beta.6"
44
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."
55

66
s.description = <<-DESC

WordPressAuthenticator/NUX/NUXViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ open class NUXViewController: UIViewController, NUXViewControllerBase, UIViewCon
2525
// MARK: associated type for NUXSegueHandler
2626
/// Segue identifiers to avoid using strings
2727
public enum SegueIdentifier: String {
28-
case showSignupMethod
2928
case showSigninV2
3029
case showURLUsernamePassword
3130
case showWPUsernamePassword

WordPressAuthenticator/Signin/Login.storyboard

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<!--Login Prologue Signup Method View Controller-->
2222
<scene sceneID="8K7-Gj-yNn">
2323
<objects>
24-
<viewController id="IwV-3R-6dB" customClass="LoginPrologueSignupMethodViewController" customModule="WordPressAuthenticator" sceneMemberID="viewController">
24+
<viewController storyboardIdentifier="LoginPrologueSignupMethodViewController" id="IwV-3R-6dB" customClass="LoginPrologueSignupMethodViewController" customModule="WordPressAuthenticator" sceneMemberID="viewController">
2525
<layoutGuides>
2626
<viewControllerLayoutGuide type="top" id="LS5-8f-iNn"/>
2727
<viewControllerLayoutGuide type="bottom" id="NZ0-gC-OHl"/>
@@ -108,7 +108,6 @@
108108
</view>
109109
<navigationItem key="navigationItem" id="42E-2e-kOq"/>
110110
<connections>
111-
<segue destination="IwV-3R-6dB" kind="presentation" identifier="showSignupMethod" id="gD5-d0-X3t"/>
112111
<segue destination="T5n-nb-cOW" kind="show" identifier="showSigninV2" id="nCA-u7-fKm"/>
113112
<segue destination="hed-vB-osh" kind="presentation" identifier="showLoginMethod" id="N3P-wt-Rn3"/>
114113
<segue destination="anK-hg-K4j" kind="show" identifier="showSelfHostedLogin" id="Njv-lY-Lyi"/>
@@ -355,7 +354,6 @@
355354
<segue destination="bAd-Df-IzS" kind="show" identifier="show2FA" id="kRR-qz-Hu2"/>
356355
<segue destination="anK-hg-K4j" kind="show" identifier="showSelfHostedLogin" id="bK1-J1-hfT"/>
357356
<segue destination="klu-4U-PyL" kind="show" identifier="showSignupEmail" id="dh4-9P-l8W"/>
358-
<segue destination="IwV-3R-6dB" kind="presentation" identifier="showSignupMethod" id="EmH-Av-vhT"/>
359357
<segue destination="T5n-nb-cOW" kind="show" identifier="showSigninV2" id="sIC-Hv-FJw"/>
360358
<segue destination="SZS-o3-1P7" kind="show" identifier="showURLUsernamePassword" id="4SK-mG-U33"/>
361359
</connections>
@@ -1453,8 +1451,7 @@
14531451
<segue reference="2Of-BA-xqb"/>
14541452
<segue reference="UV4-XI-c0q"/>
14551453
<segue reference="4SK-mG-U33"/>
1456-
<segue reference="nCA-u7-fKm"/>
1457-
<segue reference="swV-lc-6gI"/>
1458-
<segue reference="gD5-d0-X3t"/>
1454+
<segue reference="sIC-Hv-FJw"/>
1455+
<segue reference="iD4-VS-n3M"/>
14591456
</inferredMetricsTieBreakers>
14601457
</document>

WordPressAuthenticator/Signin/LoginEmailViewController.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,18 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder {
188188
let button = WPStyleGuide.wpcomSignupButton()
189189
stackView.addArrangedSubview(button)
190190
button.on(.touchUpInside) { [weak self] (button) in
191-
self?.performSegue(withIdentifier: .showSignupMethod, sender: self)
191+
guard let vc = LoginPrologueSignupMethodViewController.instantiate(from: .login) else {
192+
DDLogError("Failed to navigate to LoginPrologueSignupMethodViewController")
193+
return
194+
}
195+
196+
guard let self = self else { return }
197+
198+
vc.loginFields = self.loginFields
199+
vc.dismissBlock = self.dismissBlock
200+
vc.transitioningDelegate = self
201+
vc.modalPresentationStyle = .custom
202+
self.navigationController?.pushViewController(vc, animated: true)
192203
}
193204

194205
stackView.addConstraints([

WordPressAuthenticator/Signin/LoginPrologueViewController.swift

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,6 @@ class LoginPrologueViewController: LoginViewController {
4545
if let vc = segue.destination as? NUXButtonViewController {
4646
buttonViewController = vc
4747
}
48-
else if let vc = segue.destination as? LoginPrologueSignupMethodViewController {
49-
vc.transitioningDelegate = self
50-
51-
vc.emailTapped = { [weak self] in
52-
self?.performSegue(withIdentifier: .showSigninV2, sender: self)
53-
}
54-
vc.googleTapped = { [weak self] in
55-
guard let toVC = SignupGoogleViewController.instantiate(from: .signup) else {
56-
DDLogError("Failed to navigate to SignupGoogleViewController")
57-
return
58-
}
59-
60-
self?.navigationController?.pushViewController(toVC, animated: true)
61-
}
62-
vc.appleTapped = { [weak self] in
63-
self?.appleTapped()
64-
}
65-
vc.modalPresentationStyle = .custom
66-
}
67-
6848
else if let vc = segue.destination as? LoginPrologueLoginMethodViewController {
6949
vc.transitioningDelegate = self
7050

@@ -129,10 +109,38 @@ class LoginPrologueViewController: LoginViewController {
129109
}
130110

131111
private func signupTapped() {
132-
// This stat is part of a funnel that provides critical information. Before
133-
// making ANY modification to this stat please refer to: p4qSXL-35X-p2
112+
// This stat is part of a funnel that provides critical information.
113+
// Before making ANY modification to this stat please refer to: p4qSXL-35X-p2
134114
WordPressAuthenticator.track(.signupButtonTapped)
135-
performSegue(withIdentifier: .showSignupMethod, sender: self)
115+
116+
guard let vc = LoginPrologueSignupMethodViewController.instantiate(from: .login) else {
117+
DDLogError("Failed to navigate to LoginPrologueSignupMethodViewController")
118+
return
119+
}
120+
121+
vc.loginFields = self.loginFields
122+
vc.dismissBlock = dismissBlock
123+
vc.transitioningDelegate = self
124+
vc.modalPresentationStyle = .custom
125+
126+
vc.emailTapped = { [weak self] in
127+
self?.performSegue(withIdentifier: .showSigninV2, sender: self)
128+
}
129+
130+
vc.googleTapped = { [weak self] in
131+
guard let toVC = SignupGoogleViewController.instantiate(from: .signup) else {
132+
DDLogError("Failed to navigate to SignupGoogleViewController")
133+
return
134+
}
135+
136+
self?.navigationController?.pushViewController(toVC, animated: true)
137+
}
138+
139+
vc.appleTapped = { [weak self] in
140+
self?.appleTapped()
141+
}
142+
143+
navigationController?.present(vc, animated: true, completion: nil)
136144
}
137145

138146
private func appleTapped() {

0 commit comments

Comments
 (0)