Created
April 9, 2025 14:01
-
-
Save pookjw/c48cc113883d17b72289cfe5da50599b 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 ContentView: View { | |
@State private var value: Bool = false | |
var body: some View { | |
VStack { | |
EquatableView(content: MyView(value: value)) | |
// MyView(value: value).equatable() | |
Toggle(isOn: $value) {} | |
} | |
.padding() | |
} | |
} | |
struct MyView: UIViewRepresentable, Equatable { | |
static func ==(lhs: MyView, rhs: MyView) -> Bool { | |
true | |
} | |
let value: Bool | |
func makeUIView(context: Context) -> ContentView { | |
.init() | |
} | |
func updateUIView(_ uiView: ContentView, context: Context) { | |
print(#function) | |
} | |
final class ContentView: UIView { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment