Skip to content

Remove dummy tests, Remove ActionButtonModel #1

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

Merged
merged 1 commit into from
Nov 19, 2021

Conversation

chFlorian
Copy link
Member

Hey Trent!

In this PR I have removed ActionButtonModel, because I don't see any usage for it being an independent data type.
Instead, I have added associated values to the three cases of ActionButtonState: title, systemImage

This way the API is quite a bit easier to read:

@State var buttonState: ActionButtonState = .enabled(title: "Hello, World!", systemImage: "house")

For comparison, this is the old API:

@State var buttonState: ActionButtonState = .enabled(.init(title: "Hello, World!", systemImage: "house"))

What do you think?

I also removed the test target, because there were no actual tests.

Copy link
Member

@trentguillory trentguillory left a comment

Choose a reason for hiding this comment

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

I like it! This is much more readable. And thanks for collapsing that switch statement in ActionButtonState. It's much clearer.

@trentguillory trentguillory merged commit 5c5d92a into swiftui-library:main Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants