mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
35 lines
772 B
Swift
35 lines
772 B
Swift
//
|
|
// CornerRadiusModifier.swift
|
|
// Xcodes
|
|
//
|
|
// Created by Matt Kiazyk on 2023-12-19.
|
|
//
|
|
|
|
import Foundation
|
|
import SwiftUI
|
|
|
|
struct CornerRadiusModifier: ViewModifier {
|
|
func body(content: Content) -> some View {
|
|
content
|
|
.frame(maxWidth: .infinity, alignment: .leading)
|
|
.padding()
|
|
.background(.background)
|
|
.clipShape(RoundedRectangle(cornerRadius: 5, style: .continuous))
|
|
}
|
|
}
|
|
|
|
extension View {
|
|
func xcodesBackground() -> some View {
|
|
self.modifier(
|
|
CornerRadiusModifier()
|
|
)
|
|
}
|
|
}
|
|
|
|
struct Previews_CornerRadius_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
HStack {
|
|
Text(verbatim: "XCODES RULES!")
|
|
}.xcodesBackground()
|
|
}
|
|
}
|