title: SwiftUI ScrollView Scroll to Relative Position
body: <p>I have a big horizontal view that doesn't fit on screen, so I put it into a horizontal <code>ScrollView</code>.
  If 0 would represent scrolled to the left completely and 1 to the right completely - How can I e.g. scroll to a relative position of 0.8?</p>
  <p>Since I cannot attach an id to a child element <code>ScrollViewReader</code> doesn't seem to work.</p>
  <pre class="lang-swift prettyprint-override"><code>struct ContentView: View {
  
      var body: some View {
          ScrollView(.horizontal) {
              Text(&quot;Example for a long view without individual elements that you could use id on. Example for a long view without individual elements that you could use id on. Example for a long view without individual elements that you could use id on. Example for a long view without individual elements that you could use id on. Example for a long view without individual elements that you could use id on. Example for a long view without individual elements that you could use id on. Example for a long view without individual elements that you could use id on. Example for a long view without individual elements that you could use id on. Example for a long view without individual elements that you could use id on. Example for a long view without individual elements that you could use id on.&quot;)
          }
      }
  }
  </code></pre>