title: Init a class from my second view with data from the first
body: <p>In my initial ContentView() I have a button that presents a UIImagePicker, when an image is chosen I then navigate to SecondView where I can view the image and it’s data from UIImagePickerController.InfoKey </p>
  
  <p>I currently have an ImageManager class that’s set as an EnviromentObject that I pass the InfoKey to that then sets up all the variables in that class — it works but this feels messy. </p>
  
  <p>What I’d like to do is init the ImageManager class when I navigate to SecondView as that’s the only view that needs that data. </p>
  
  <p>I’d tried passing the InfoKey as a variable:</p>
  
  <pre><code>@State var InfoKey: [IImagePickerController.InfoKey: Any]
  
  SecondView(key: self.infoKey)
  </code></pre>
  
  <p>but this crashes because I don’t have any data until an image is chosen</p>
  
  <p>What would be the best way to tackle this?</p>