I'm trying to find a way to draw a iOS 7-style icon 'squircle' shape programmatically, using core graphics. I'm not asking how to draw a rounded rectangle. A squircle is a superellipse:
![Squircle](https://i.stack.imgur.com/rsKHM.png)
which is slightly different than a regular rounded rectangle:
![Rounded rectangle vs squircle](https://i.stack.imgur.com/a4UgN.png)
![Music icon in squircle](https://i.stack.imgur.com/jx1lQ.jpg)
It's exact formula is readily available. However, I can't figure out how to draw this using, for example, a CGPath, let alone fill it, and be able to resize it rather easily. All this while being entirely exact with the formula.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…