Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NT-394] Fix loading button title restoration #919

Merged
merged 1 commit into from
Oct 30, 2019

Conversation

justinswart
Copy link
Contributor

📲 What

Fixes a small bug which left our button title empty after the loader was hidden.

🤔 Why

This was just a small oversight in #892.

🛠 How

Fixed what was essentially just a copy-paste error.

👀 See

Before 🐛 After 🦋
image image

♿️ Accessibility

  • Tap targets use minimum of 44x44 pts dimensions
  • Works with VoiceOver
  • Supports Dynamic Type

✅ Acceptance criteria

  • Update your pledge, after loading completes the button title should be set again. Use Charles proxy with breakpoints or slow down animations to confirm.

@@ -115,7 +115,7 @@ final class LoadingButton: UIButton {
let states: [UIControl.State] = [.disabled, .highlighted, .normal, .selected]

states.compactMap { state -> (String, UIControl.State)? in
guard let title = self.title(for: state) else { return nil }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bug was just that this line was copy-pasted from the block above whereas it should in fact be restoring the title from the array and not self.title(for:).

Copy link
Contributor

@dusi dusi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job Jazzy!

Thanks for fixing your own mistakes that I committed 😂😂😂

Copy link
Contributor

@Scollaco Scollaco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this, @justinswart !

@justinswart justinswart merged commit c600794 into master Oct 30, 2019
@justinswart justinswart deleted the fix-loading-button-title branch October 30, 2019 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants