On iOS 11, CALayer has a `continuousCorners` private property [0].
I did a spartan reverse engineering by recreating the UIBezierPath equivalent of the two types of radii found in the Apple Design Resources [1], then adding a convenience initializer on UIBezierPath that recreates the shape with arbitrary radius of the chosen kind (either UISwitch-like, or App Icon-like).
Earlier attempts include the fascinating Unleashing Genetic Algorithms on the iOS 7 Icon [2].
I did a spartan reverse engineering by recreating the UIBezierPath equivalent of the two types of radii found in the Apple Design Resources [1], then adding a convenience initializer on UIBezierPath that recreates the shape with arbitrary radius of the chosen kind (either UISwitch-like, or App Icon-like).
Earlier attempts include the fascinating Unleashing Genetic Algorithms on the iOS 7 Icon [2].
[0] https://mobile.twitter.com/argentumko/status/955773459463790...
[1] https://developer.apple.com/design/resources/
[2] http://blog.mikeswanson.com/post/62341902567/unleashing-gene...