Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a public api for getting the fancier rounded corners in modern iOS?

Tags:

ios

Starting with iOS 7, Apple have been using nicer rounded corners in visual elements such as icons. In iOS 11, these rounded corners are abundant in system UI elements, such as Control Center and many other places.

the cornerRadius APIs on eg CALayer etc are more basic.

Is there some API which gives you the nice new roundedness?

see for example this question: Draw iOS 7-style squircle programmatically

also see how the answers to the question are not good; a few years onwards, is there an Apple API which gives you this type of corner curve?

like image 876
spinalwrap Avatar asked Oct 14 '17 02:10

spinalwrap


1 Answers

Now in iOS 13 and Xcode 11, you can use CALayerCornerCurve

Sample usage:

yourLayer.cornerCurve = CALayerCornerCurve.continuous
like image 91
Ted Avatar answered Oct 27 '22 00:10

Ted