編集: 読みやすさを改善するために言語が更新されました。
次のように 2 つの角が丸いイメージ ビューを作成しました。
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.photoImageView.bounds byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)];
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.path = maskPath.CGPath;
self.photoImageView.layer.mask = maskLayer;
ただし、このコードを使用してすべての角を丸くするよりも遅くなります。
self.photoImageView.layer.cornerRadius = 10;
「2コーナー」コードを改善する理由と方法を知っている人はいますか?