Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CUSTOM MODIFIERS
- struct Title: ViewModifier {
- func body(content: Content) -> some View {
- HStack {
- content
- .font(.largeTitle)
- .foregroundColor(.blue)
- }
- }
- }
- extension View {
- func bigBlueTitle() -> some View {
- self.modifier(Title())
- }
- }
- struct CustomModifiers: View {
- var body: some View {
- Text("Hello World!"/)
- .bigBlueTitle()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment