Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.
Merged
2 changes: 1 addition & 1 deletion WordPressAuthenticator.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "WordPressAuthenticator"
s.version = "1.10.5-beta.2"
s.version = "1.10.5-beta.3"
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."

s.description = <<-DESC
Expand Down
4 changes: 4 additions & 0 deletions WordPressAuthenticator/Signin/Login.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
</constraints>
</view>
<connections>
<outlet property="dismissButton" destination="gpM-nW-lFQ" id="8iA-TH-TF4"/>
<segue destination="fwZ-QE-5et" kind="show" identifier="showEmailLogin" id="1xT-tL-sp6"/>
</connections>
</viewController>
Expand Down Expand Up @@ -1450,6 +1451,9 @@
<constraint firstAttribute="trailing" secondItem="Ueg-Bw-KU6" secondAttribute="trailing" id="nXh-Tu-veg"/>
</constraints>
</view>
<connections>
<outlet property="dismissButton" destination="Ueg-Bw-KU6" id="icp-fM-bz4"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Rrd-X3-roK" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class LoginPrologueLoginMethodViewController: NUXViewController {
open var selfHostedTapped: (() -> Void)?
open var appleTapped: (() -> Void)?

/// The big transparent (dismiss) button behind the buttons
@IBOutlet private weak var dismissButton: UIButton!

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
super.prepare(for: segue, sender: sender)

Expand All @@ -24,6 +27,7 @@ class LoginPrologueLoginMethodViewController: NUXViewController {
override func viewDidLoad() {
super.viewDidLoad()
configureButtonVC()
configureForAccessibility()
}

override func viewWillAppear(_ animated: Bool) {
Expand Down Expand Up @@ -85,4 +89,23 @@ class LoginPrologueLoginMethodViewController: NUXViewController {
appleTapped?()
}

// MARK: - Accessibility

private func configureForAccessibility() {
dismissButton.accessibilityLabel = NSLocalizedString("Dismiss", comment: "Accessibility label for the transparent space above the login dialog which acts as a button to dismiss the dialog.")

// Ensure that the first button (in buttonViewController) is automatically selected by
// VoiceOver instead of the dismiss button.
if buttonViewController?.isViewLoaded == true, let buttonsView = buttonViewController?.view {
view.accessibilityElements = [
buttonsView,
dismissButton
]
}
}

override func accessibilityPerformEscape() -> Bool {
dismiss(animated: true)
return true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class LoginPrologueSignupMethodViewController: NUXViewController {
open var googleTapped: (() -> Void)?
open var appleTapped: (() -> Void)?

/// The big transparent (dismiss) button behind the buttons
@IBOutlet private weak var dismissButton: UIButton!

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
super.prepare(for: segue, sender: sender)

Expand All @@ -25,6 +28,7 @@ class LoginPrologueSignupMethodViewController: NUXViewController {
override func viewDidLoad() {
super.viewDidLoad()
configureButtonVC()
configureForAccessibility()
}

override func viewWillAppear(_ animated: Bool) {
Expand Down Expand Up @@ -82,8 +86,7 @@ class LoginPrologueSignupMethodViewController: NUXViewController {
}

@IBAction func dismissTapped() {
WordPressAuthenticator.track(.signupCancelled)
dismiss(animated: true)
trackCancellationAndThenDismiss()
}

@objc func handleAppleButtonTapped() {
Expand All @@ -92,4 +95,29 @@ class LoginPrologueSignupMethodViewController: NUXViewController {
dismiss(animated: true)
appleTapped?()
}

private func trackCancellationAndThenDismiss() {
WordPressAuthenticator.track(.signupCancelled)
dismiss(animated: true)
}

// MARK: - Accessibility

private func configureForAccessibility() {
dismissButton.accessibilityLabel = NSLocalizedString("Dismiss", comment: "Accessibility label for the transparent space above the signup dialog which acts as a button to dismiss the dialog.")

// Ensure that the first button (in buttonViewController) is automatically selected by
// VoiceOver instead of the dismiss button.
if buttonViewController?.isViewLoaded == true, let buttonsView = buttonViewController?.view {
view.accessibilityElements = [
buttonsView,
dismissButton
]
}
}

override func accessibilityPerformEscape() -> Bool {
trackCancellationAndThenDismiss()
return true
}
}