Question: I am trying to create a textfield with left corners rounded off. For that I've used the following code to apply masking. Now the corners of the textfield are trimmed off. Any idea why?

```
    let shape = CAShapeLayer()
    shape.bounds = textfieldContainerView.frame
    shape.position = textfieldContainerView.center
    shape.path = UIBezierPath(roundedRect: textfieldContainerView.bounds,
                              byRoundingCorners: [.topLeft, .bottomLeft],
                              cornerRadii: CGSize(width: 5, height: 5)).cgPath
    textfieldContainerView.layer.mask = shape
    textfieldContainerView.layer.borderColor = ColorKit.smoke.cgColor
    textfieldContainerView.layer.borderWidth = 2.0

```

Here's how it looks like (notice the broken corners on the left).

[![enter image description here](https://i.stack.imgur.com/XCjUY.png)](https://i.stack.imgur.com/XCjUY.png)

Answer: 
Update: retested with Xcode 13.3 / iOS 15.4
-------------------------------------------

Try the following (built-in container by default expanded to size of GeometryReader and have explicit default alignment set to center by both dimensions). Tested with Xcode 11.2.

```
var body: some View {
    GeometryReader { geometry in
       VStack { // explicit container with center default alignment
        ImageContent()
       }
       .frame(maxWidth: .infinity, maxHeight: .infinity)
    }
}

```
I just ran into the same problem and I don't like the solution of setting the position manually because it complicates the process of automatically generating layout. For me the problem persists even after wrapping my content in a VStack. However, if you wrap the content in a VStack AND also manually set its frame - everything works as expected:

```
var body: some View {
    GeometryReader { geometry in
       VStack {
        ImageContent()
       }
       .frame(width: geometry.size.width, height: geometry.size.height)
    }
}

```

I think this issue pops up because GeometryReader's internal layout acts like a ZStack and it needs more information.