title: Swift UI: Center Text into Circle
body: <p>I try to put a circle-shaped frame around a text view, but I just can't get it properly aligned and I can't see where the problem is. As you can see in the picture below, the text is sometimes offset to left, while it should be centred. Any ideas on how to fix it?</p>
  
  <p><a href="https://i.stack.imgur.com/kFJof.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kFJof.png" alt="enter image description here"></a></p>
  
  <pre class="lang-swift prettyprint-override"><code>struct ContentView: View {
      let result = getDate();
      var body: some View {
          VStack {
              ScrollView(.horizontal, showsIndicators: false) {
                  HStack(alignment: .top, spacing: 5) {
                      ForEach(result, id: \.self) {
                          day in
                          Text(day.name!)
                              .frame(width: 35, height: 35, alignment: .center)
                              .padding()
                              .overlay(
                                  Circle()
                                      .size(width: 35, height: 35)
                                      .offset(x: 17.5,y: 17.5)
                                      .scale(1.4)
                                      .stroke(Color.orange, lineWidth: 4)
                              )
                      }
                  }
              }
          Spacer()
          }.background(Color.white)
  
      }
  }
  </code></pre>
  
  <p>The circle is offset by half of the size of the frame, so its origin should be in the centre. The Text should be centered as well in .frame(width: 35, height: 35, alignment: .center).</p>
  
  <p>Thanks a lot for helping! :)</p>