Created
September 8, 2020 05:33
-
-
Save ytyubox/224a34546a8938d63b0797c958005d77 to your computer and use it in GitHub Desktop.
Markdium-Inheriting existing Class type to support ObservableObject
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
struct SomeView: View { | |
@ObservedObject var gamePlayer = UIGamePlayer() | |
var body: some View { | |
Button(action: { | |
self.gamePlayer.exp += 1 | |
}) { | |
Text(gamePlayer.exp.description) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment