Created
April 3, 2021 17:08
-
-
Save lammertw/519050fa62cfd115425dae884e4fa635 to your computer and use it in GitHub Desktop.
This file contains 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
struct CountView: UIViewControllerRepresentable { | |
@EnvironmentObject var counter: ObservableCounter | |
typealias UIViewControllerType = CountViewController | |
func makeUIViewController(context: Context) -> CountViewController { | |
return CountViewController() | |
} | |
func updateUIViewController(_ uiViewController: CountViewController, context: Context) { | |
uiViewController.count = counter.count | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment