Post

Replies

Boosts

Views

Activity

Reply to How to save return value from function in swift ui and use it
Okay typical me hours for hours no answer to the problem and when I am asking, I find it right away... My solution: func returnDirString () -> String {     let dir = "/some/return/string"     return dir } func usingDirString (strUpper: String) {     print(strUpper) } struct ContentView: View {     @State var processString = ""     var body: some View {         Button(action: {             let someString = returnDirString()             $processString.wrappedValue = someString         }) {             Text("Read Apk")         }         .padding()         Button(action: {             usingDirString (strUpper: processString)         }) {             Text("Sign Apk")         }         .padding()     } } But is there a better one please discuss, I am curious!
Jul ’21