[fix] redraw RoughUIView when the options are changed #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, I find an issue when using RoughSwift, but I‘m not sure if it‘s a bug.
Then I submitted the PR to fix it. Please review the code to see if it is reasonable.
The issue is when I use the
@State
to update some values in the options of RoughView, but the RoughView does not refresh. So I added theupdate
function todidSet
in the options. Because I have to figure out if the old options are equal to the new options. So I made theOptions
to confirm theHashable
protocol.Here is the video after the code is updated:
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-02-12.at.22.19.43.mp4