title: How to initialize data in Preview provider in SwiftUI
body: <p>I am trying to fetch data from localhost, make a list of posts with List View and pass data to CustomDetailView. Here is my code for NetworkManager:
  <a href="https://i.stack.imgur.com/45EDL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/45EDL.png" alt="enter image description here"></a></p>
  
  <p>My ListView:
  <a href="https://i.stack.imgur.com/wA3Gh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wA3Gh.png" alt="enter image description here"></a></p>
  
  <p>And StoryDetails View:
  <a href="https://i.stack.imgur.com/lUnmz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lUnmz.png" alt="enter image description here"></a></p>
  
  <p>So what I have to pass to StoryDeatils_Preview?</p>
  
  <p>Here is the StoryDetails code</p>
  
  <pre><code>import SwiftUI
  
  struct StoryDetails: View {
      var story: Story
      var body: some View {
          VStack(alignment: .leading) {
              HStack {
                  Text("story #123456")
                      .font(.callout)
                      .foregroundColor(Color.gray)
                  Spacer()
                  Text("5 days ago")
                      .font(.callout)
                      .foregroundColor(Color.gray)
                  Button(action:{
                      print("Hello there")
                  }){
                      Image(systemName:"info.circle").resizable()
                          .frame(width:22.0, height:22.0)
                          .accentColor(Color.gray)
                  }
              }
              Text(story.body)
                  .foregroundColor(.black)
                  .kerning(1)
                  .lineLimit(nil)
              HStack {
                  Button(action: {
                      print("Hello World")
                  }){
                      HStack {
                          Image(systemName:"heart")
                              .accentColor(.black)
                          Text("233")
                              .foregroundColor(.black)
                      }
                      .padding(.trailing)
                      HStack {
                          Image(systemName:"bubble.left")
                              .accentColor(.black)
                          Text("45")
                              .foregroundColor(.black)
                      }
                  }
              }
          }
      }   
  }
  
  struct StoryDetails_Previews: PreviewProvider {
      static var previews: some View {
          StoryDetails(
              story: Story(
                  id: 1,
                  author: 1,
                  body: "Testing",
                  edited_time: "September 2019",
                  pub_date: "October 2018",
                  comments: [Comment](),
                  story_likes: [StoryLike]()
               )
          )
      }
  }
  </code></pre>
  
  <p>Error:
  <a href="https://i.stack.imgur.com/sgkFC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sgkFC.png" alt="enter image description here"></a></p>