I am trying to set Text value in my SwiftUI code from a char* string stored in cpp whenever a button is pressed .I was able to do similar think in UIkit based application and since i am new to SwiftUI not able to do same in SwiftUI.
SwiftUI code :
@state var title = "Title"
var body: some View {
Text(title)
.bold()
.font(.system(size: 40))
.frame(width: 250,height: 200,alignment: .center )
Button("Change title", action: ChangeTitle)
}
func ChangeTitle () {
//change value of title
}
}
Want to change the value of var title to char* str in cpp when button is pressed.