SHARE
TWEET

Untitled

a guest Jan 19th, 2020 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct ContentView: View {
  2.    
  3.     @ObservedObject private var counterVM: CounterViewModel = CounterViewModel()
  4.    
  5.     var body: some View {
  6.         VStack {
  7.             Text("\(self.counterVM.counter)")
  8.            
  9.             HStack {
  10.                 Button("Increment") {
  11.                     self.counterVM.increment()
  12.                 }
  13.                 Button("Decrement") {
  14.                     self.counterVM.decrement()
  15.                 }
  16.             }
  17.         }
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top