Created
October 11, 2019 19:46
-
-
Save azamsharp/8ef33eeaa48e86de841257247d9ffdb2 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
import SwiftUI | |
struct Facebook: View { | |
@EnvironmentObject var userSettings: UserSettings | |
var body: some View { | |
VStack { | |
Text("Facebook") | |
Button("👍") { | |
self.userSettings.likes += 1 | |
} | |
} | |
} | |
} | |
struct Twitter: View { | |
@EnvironmentObject var userSettings: UserSettings | |
var body: some View { | |
VStack { | |
Text("Twitter") | |
Button("👍") { | |
self.userSettings.likes += 1 | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment