title: SwiftUI - Get size of child?
body: <p>Is there any way to get the size of a child view in SwiftUI?</p>
  
  <p>I'm basically looking to do the UIKit equivalent of:</p>
  
  <pre class="lang-swift prettyprint-override"><code>self.child.frame.origin.x -= self.child.intrinsicContentSize.width/2.0
  </code></pre>
  
  <p>I don't think a GeometryReader would work since that returns the available size in the parent.</p>
  
  <p>[Edit] I've found it's possible to get and save the dimensions using <code>.alignmentGuide(_, computeValue:)</code> though that's definitely a hack.</p>
  
  <pre class="lang-swift prettyprint-override"><code>LessonSliderText(text: self.textForProgress(self.progress), color: self.completedColor)
      .alignmentGuide(HorizontalAlignment.leading) { (dimensions) -&gt; Length in
          self.textSize = CGSize(width: dimensions.width, height: dimensions.height)
          return 0
      }
      .offset(x: self.width*self.currentPercentage - self.textSize.width / 2.0)
      .offset(y: -self.textSize.height/2.0)
      .animation(nil)
      .opacity(self.isDragging ? 1.0 : 0.0)
      .animation(.basic())
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/LmgDl.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LmgDl.png" alt="What I&#39;m trying to accomplish"></a></p>