title: MVVM and passing over optinal value to the viewModel
body: <p>I am trying to get a MVVM approach to work for my swiftui app but I have a problem where a optional variabel does not seem to get passed over correct.</p>
  <p>So the home view you can click either on &quot;new&quot; or &quot;edit&quot;, on edit I want to pass the value over, the code for this screen:
  Button:</p>
  <pre><code>Button {
          selectedTag = tag
          isShowingEdit.toggle()
  } label: {
           Image(systemName: &quot;pencil&quot;)
           .font(Font.system(size: 30, weight: .bold))
           .foregroundColor(.gray)
  }
  </code></pre>
  <p>Navigationlink:</p>
  <pre><code>  NavigationLink(destination: TagsCreatingView(viewModel: TagCreateViewModel(tag: selectedTag)), isActive: $isShowingEdit) { EmptyView() }
  </code></pre>
  <p>The TagCreateViewModel init looks as following:</p>
  <pre><code>  init(tag: TagMO?) {
  
      if let tag = tag {
      self.tag = tag
          title = tag.title
          selectedColor = Int(tag.color)
      }
  </code></pre>
  <p>If I do a print on selectedTag when I click the button it has the correct value, but over inte the viewModel it will be nil. Also if I click the edit button twice it works as planned and tag is not nil ( by twice I mean click edit, on the other screen click cancel then edit again..)</p>