はじめに
iOS15以下を対応する場合は以下の記事の方法が良さそうです。
完成サンプル
実装
import SwiftUI
struct ContentView: View {
var body: some View {
Image(.sample)
.resizable()
.scaledToFit()
+ .clipShape(.rect(
+ topLeadingRadius: 0,
+ bottomLeadingRadius: 50,
+ bottomTrailingRadius: 0,
+ topTrailingRadius: 50
+ ))
.padding(20)
}
}
おわり
iOS16からめっちゃ簡単に書けるようになりましたね
公式ドキュメント