程式手刻 emoji 表情符號 & logo
Published in
3 min readAug 8, 2018
挑選喜歡的 emoji 表情符號 & logo,從程式一步一腳印將它刻出來吧 !
提示
如何製作半圓形的微笑曲線
方法 1: 利用 UIBezierPath
方法 2 : 利用 clipsToBounds & cornerRadius
var rect = CGRect(x: 0, y: -50, width: 100, height: 100)let smileView = UIView(frame: rect)smileView.layer.borderWidth = 10smileView.layer.borderColor = UIColor(red: 1, green: 0, blue: 0, alpha: 1).cgColorsmileView.layer.cornerRadius = 50smileView.clipsToBounds = truerect = CGRect(x: 0, y: 0, width: 100, height: 50)let smileBackgroundView = UIView(frame: rect)smileBackgroundView.addSubview(smileView)smileBackgroundView.clipsToBounds = true