title: SwiftUI and MVVM: Is using multiple viewModels in one view 'valid'?
body: <p>This is more a general question: I'm working on my first SwiftUI project and using MVVM for the first time as well. After programming some views I realized that I need for almost each view two different view models. Often it's the view model for the current view and the view model of the previous/mother view. Is this &quot;normal&quot; or is this a hint that I've designed my project wrong and abusing MVVM?</p>
  <p>For example:</p>
  <p>I have a view where I list all flashcard decks. For this view I have a <code>decksViewModel</code>that looks like this:</p>
  <pre><code>class DeckListViewModel: ObservableObject{
      @Published var decks = [Deck]
      @Published var showDeck = false // this value will be true if i tab on a deck and the deck will shown in a detailed view. This value is checked in the list
      @Published var expandButton = false
      @Published var showDownloadCenter = false
      @Published var showCreateDeck = false
  }
  </code></pre>
  <p>Now I have a <code>deckDetailView</code> for the detailed view of my deck. The <code>deckDetailViewModel</code> stores the selected item. But to remove this view I need to change the value of the <code>showDeck? in </code>decksViewModel`. So I need to pass this view model as well.</p>