Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created October 11, 2019 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azamsharp/8ef33eeaa48e86de841257247d9ffdb2 to your computer and use it in GitHub Desktop.
Save azamsharp/8ef33eeaa48e86de841257247d9ffdb2 to your computer and use it in GitHub Desktop.
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