#shorts SwiftUI gives us a dedicated border () modifier to draw borders around views. It has a few variations depending on whether you want to specify a stroke or a corner radius, so here are a few examples.
How To Use Border in SwiftUI (SwiftUI Border, Border SwiftUI, Shape Border SwiftUI)