// โญ๏ธ custom label style
struct RedBorderedLabelStyle: LabelStyle {
// โญ๏ธ protocol's only requirement
func makeBody(configuration: Configuration) -> some View {
Label(configuration)
.padding(4)
.border(Color.red)
}
}
// ๐ .redBorder
// โญโโโโโโโโโ โญ๏ธ important โโโโโโโโโโโฎ
extension LabelStyle where Self == RedBorderedLabelStyle {
// extension supports "computed properties" (no "stored properties")
public static var redBorder: RedBorderedLabelStyle {
RedBorderedLabelStyle()
}
}