[Swift] 뷰의 특정 모서리에 round 처리하기 + border
보통 뷰의 모서리를 다 둥글게 한다. 가끔 특정 모서리만 둥글게 하고 싶을 때도 있다. 근데 테두리도 넣어야한다? 구글링구글링.. 모서리를 그리는 방법에는 두가지가 있다. UIBezierPath와 CACornerMask 후자는 iOS 11이상부터 사용가능하다고 한다. BezierPath로 둥근 모서리 만들기 let path = UIBezierPath(roundedRect: rectCornerView.bounds, byRoundingCorners: [.topLeft, .topRight], cornerRadii: CGSize(width: 12, height: 12)) let mask = CAShapeLayer() mask.path = path.cgPath rectCornerView.layer.mask = m..
2022.03.10