SwiftUI view only displays final state (not updating)

My GUI involves a button as well as text. When the button is pressed, it triggers a function which modifies a string state over and over. The text being displayed is that state variable but during the function call the view does not update although the function is altering the state. After the function call I can see the text update with the final value of this state but I miss all the intermediary values while staring at a frozen view. Is there any way to update the view each time the value is changed?

during the function call the view does not update although the function is altering the state.

Usually, while your function call is occupying the main thread, UI updates are delayed until the main thread is freed.
You may need to run your function in the background thread and do only state updating in the main thread.

There may be some other reasons, but I can say nothing sure without seeing your code.
Can you show us your code?
SwiftUI view only displays final state (not updating)
 
 
Q