title: SwiftUI View - viewDidLoad()?
body: <p>Trying to load an image after the view loads, the model object driving the view (see MovieDetail below) has a urlString.  Because a SwiftUI <code>View</code> element has no life cycle methods (and there's not a view controller driving things) what is the best way to handle this?</p>
  
  <p>The main issue I'm having is no matter which way I try to solve the problem (Binding an object or using a State variable), my View doesn't have the <code>urlString</code> until after it loads...</p>
  
  <pre class="lang-swift prettyprint-override"><code>// movie object
  struct Movie: Decodable, Identifiable {
  
      let id: String
      let title: String
      let year: String
      let type: String
      var posterUrl: String
  
      private enum CodingKeys: String, CodingKey {
          case id = "imdbID"
          case title = "Title"
          case year = "Year"
          case type = "Type"
          case posterUrl = "Poster"
      }
  }
  </code></pre>
  
  <pre class="lang-swift prettyprint-override"><code>// root content list view that navigates to the detail view
  struct ContentView : View {
  
      var movies: [Movie]
  
      var body: some View {
          NavigationView {
              List(movies) { movie in
                  NavigationButton(destination: MovieDetail(movie: movie)) {
                      MovieRow(movie: movie)
                  }
              }
              .navigationBarTitle(Text("Star Wars Movies"))
          }
      }
  }
  </code></pre>
  
  <pre class="lang-swift prettyprint-override"><code>// detail view that needs to make the asynchronous call
  struct MovieDetail : View {
  
      let movie: Movie
      @State var imageObject = BoundImageObject()
  
      var body: some View {
          HStack(alignment: .top) {
              VStack {
                  Image(uiImage: imageObject.image)
                      .scaledToFit()
  
                  Text(movie.title)
                      .font(.subheadline)
              }
          }
      }
  }
  </code></pre>
  
  <p>Thanks in advance.</p>