struct TitleModifier: ViewModifier {
func body(content: Content) -> some View {
content
.font(.largeTitle)
}
}
var body: some View {
Text("Bigger Text")
.modifier(TitleModifier())
}
extension View {
func title() -> some View {
self
.font(.largeTitle)
}
}
var body: some View {
Text("Bigger Text")
.title()
}