Hi,
It looks like you are passing the return Value from the GetValue() function into the Text Element.
Try this:
Text(sharedObj.CustomString)
Button(action: {
sharedObj.Update(input: "NewValue")
}){
Text("Update")
}
When you call the update function the Custom String is automatically updated in the Text Element.
Take care,
David
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: