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

[Button-367] Refactoring #701

Merged
merged 6 commits into from
Jan 17, 2024
Merged

Conversation

robergro
Copy link
Contributor

@robergro robergro commented Dec 22, 2023

Content:

  • Update ViewModels
  • Update View and add IconButton
  • Add SwiftUI version
  • Update snapshot testing
  • Update demo

This pull request has:

  • Code documentation on publics
  • Accessibility
    • Dynamic sizes
    • Identifiers
  • Tests
  • Demo update
  • Wiki

Copy link
Contributor

@michael-zimmermann michael-zimmermann left a comment

Choose a reason for hiding this comment

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

The state changes in the demo don't work for the (SwiftHI) icon button.

E.g, when I press the button, no image is shown.
Bildschirmfoto 2023-12-28 um 12 40 03

The same problems exist with the disabled and selected states.

Copy link
Contributor

@michael-zimmermann michael-zimmermann left a comment

Choose a reason for hiding this comment

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

In the demo, the UIKit button and icon button don't change their appearance whether it's in selected state or not.
Bildschirmfoto 2023-12-28 um 12 45 01

Copy link
Contributor

@michael-zimmermann michael-zimmermann left a comment

Choose a reason for hiding this comment

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

In the SwiftUI button there are some state changes not reflected:
Given:

  • normal state: none
  • highlighted state: text/Image ....
    When: the button is pressed
    Then: the button doesn't change
    Given:
  • normal state: Image and attributed text
  • highlighted: none
    When: the button is pressed
    Then: an icon is shown

And different combinations such as above

@robergro
Copy link
Contributor Author

@michael-zimmermann,
Thank you for all your comments 💪

So, I update the code:

  • I removed the manager, I replaced it with viewModel protocol (ButtonMainSUIViewModel) and two viewModel (IconButtonSUIViewModel & ButtonSUIViewModel) only for SwiftUI.
  • There is no more multiple observable object on the views (just the viewmodel)
  • On the demo app: it is no this is no longer possible to have no text in the button for the normal state.
  • On the demo app: it is no this is no longer possible to have no image in the icon button for the ** for the normal state**.

Copy link
Contributor

@michael-zimmermann michael-zimmermann left a comment

Choose a reason for hiding this comment

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

I think the ControlStatus can remain as a struct
👍 Looks good

@robergro robergro merged commit e73b98a into refacto/button/all Jan 17, 2024
4 checks passed
@robergro robergro deleted the refacto/button/snapshot branch January 17, 2024 14:57
@robergro robergro mentioned this pull request Jan 18, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants