Draw iOS 7-style squircle programmatically

后端 未结 7 2095
深忆病人
深忆病人 2020-12-07 19:15

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

相关标签:
7条回答
  • 2020-12-07 20:01

    in iOS 13/ Xcode 11 you can now use CALayerCornerCurve

    Example

    yourLayer.cornerCurver = CALayerCornerCurve.continuous
    

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

    0 讨论(0)
提交回复
热议问题