iosuibezierpathiphone-x

Actually duplicate / extract Apple's "continuous corners for iPhoneX"?


Historic question.

Pls note, it's now this simple:

https://stackoverflow.com/a/59993994/294884


The unusual bottom corners of an iPhoneX are Apple's new (2017) "continuous corners for iPhoneX".

It is trivial for any experienced iOS programmer to approximate the curve, but:

Does anyone know exactly how to achieve these, exactly as Apple does?

Even if it's a private call, it would be good to know.

It does seem bizarre that Apple have not explained this.

enter image description here

Please note that it's trivial to "approximate" the curve:

To repeat,

  1. it is trivial for any experienced iOS programmer to approximate the curve.

  2. The question being asked here is specifically how to do Apple actually do it?

Please do not post any more answers showing beginners how to draw a curve and approximate the iPhone curve.


Solution

  • As of iOS 13, there's an API available for this:

    https://developer.apple.com/documentation/quartzcore/calayercornercurve

    See CALayerCornerCurve.continuous