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

Add Binding mock to represent a mock value that can change. #21

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sheikhbayazid
Copy link
Contributor

This can be useful only in the Previews when we want to see how the view looks when binding states changes.

Example:

Toggle("Switch", isOn: .mock(true))

Tapping on the Toggle will changes the state of the binding.

Copy link
Collaborator

@lemonandlime lemonandlime left a comment

Choose a reason for hiding this comment

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

Nice

Copy link

@AndreasShortcut AndreasShortcut left a comment

Choose a reason for hiding this comment

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

Cool 👍

@sheikhbayazid
Copy link
Contributor Author

For some reason, it does not work with custom viewStyles otherwise it works great, I will make it draft now and when I fix it I will make it ready for review again.

@sheikhbayazid sheikhbayazid marked this pull request as draft January 2, 2023 08:52
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.

4 participants