marinofelipe / CurrencyText

Currency text field formatter available for UIKit and SwiftUI 💶✏️

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple SwiftUI Warnings on >iOS 16.X

leafarenuk opened this issue · comments

What problems I want to solve?

There are mutliple warnings on iOS >16.X while using your code:
Publishing changes from within view updates is not allowed, this will cause undefined behavior.

File: CurrencyText/tree/main/Sources
Lines: 73, 122 and 124

CleanShot 2022-11-20 at 01 50 20

What value it delivers?

There will be no more warnings while running the app. Improve stability.

Tasks

TBD

Dependecies / References

No dependencies and/or references by now.

Hey @leafarenuk, thanks for the heads up.

So far the project wasn't checked against the latest iOS version and Xcode/Swift toolchains, good to know there is this issues.
I'll try and find some time the next few days to check and have it fixed.
Also, if you feel like trying it out, feel free to do so, I can help with some pointers if needed.

@marinofelipe This should be as simple as wrapping those two assignments operations in a DispatchQueue.main.async I can make a PR if you'd like?

Thanks a lot @Andrewangeta 🙇