Created
February 2, 2026 11:48
-
-
Save pookjw/4c1759df02f51b25f7beb5a657798a45 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct MyData: Equatable { | |
| static func == (lhs: MyData, rhs: MyData) -> Bool { | |
| return true | |
| } | |
| var number: Int | |
| } | |
| struct ContentView: View { | |
| @State private var myData = MyData(number: 0) | |
| @State private var trigger: UInt8 = 0 | |
| var body: some View { | |
| Text(trigger.description) | |
| Button(myData.number.description) { | |
| myData.number &+= 1 | |
| trigger &+= 1 | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment