Created
November 3, 2019 04:49
-
-
Save rudrankriyam/ad8fb9aaa3e2584436c4720f166218c6 to your computer and use it in GitHub Desktop.
A custom modifier for creating a beautiful rounded background for your Views in SwiftUI.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CustomModifier.swift | |
// | |
// Created by Rudrank Riyam on 03/11/19. | |
// Copyright © 2019 Rudrank Riyam. All rights reserved. | |
// | |
import SwiftUI | |
struct BackgroundModifier: ViewModifier { | |
func body(content: Content) -> some View { | |
content | |
.foregroundColor(.white) | |
.font(.headline) | |
.padding() | |
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading) | |
.background(RoundedRectangle(cornerRadius: 15, style: .continuous) | |
.fill(Color(UIColor.secondarySystemGroupedBackground))) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment