I am trying to figure out how to mask a UIView to display a shape representing a square and a half circle sitting on it.
Basically, it will be similar to applying the border radius for only the top two corners to round them and create an arc.
I use fast and it drives me crazy.
EDIT: CornerRadius is not doing what I want. I feel like I have to use CGShapeLayer, but I'm not sure how to create an arc.
EDIT2: 
EDIT3:
Given the explanation of what I want, providing pictures and explaining that I donβt understand what I need to do, or how I need it, is not enough for some people, this is what I tried:
Trying to set the layer.cornerRadius property and then bring the bottom of the view off the screen to hide the lower corners from cropping, this type of masking was too circular and did not provide the correct arc results.
I tried using UIBezierPath by setting the top two corners to use cornerRadii from width / 2 views. It also did not produce proper results. Trying to assign hardcode values ββto cornerRadii, I noticed that regardless of the value, I could not get the results that I wanted.
What other options are there? Or am I just using BezierPath incorrectly?
EDIT 4:
Here is my original code.
override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) let bezierPath = UIBezierPath(roundedRect: navBarView.bounds, byRoundingCorners: [.TopLeft, .TopRight], cornerRadii: CGSizeMake(navBarView.bounds.width / 2, navBarView.bounds.width / 2)).CGPath; let shapeLayer = CAShapeLayer(); shapeLayer.bounds = navBarView.bounds shapeLayer.path = bezierPath navBarView.layer.mask = shapeLayer updateUI()
Also, as mentioned earlier, an attempt to make navBarView.layer.cornerRadius = x