IOS_Boss/IOS_study/Extension/View+Label.swift
2025-07-01 11:41:38 +08:00

78 lines
1.5 KiB
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// View+Label.swift
// IOS_study
//
// Created by CC-star on 2025/6/12.
//
import SwiftUI
extension View {
func padding1() -> some View{
padding(.vertical,2)
.padding(.horizontal,3)
}
func padding3() -> some View{
padding(.vertical,4)
.padding(.horizontal,7)
}
func redBorder() -> some View{
size12()
.red()
.semib()
.padding1()
.border(borderColor: Color.red)
}
func accentBorder() -> some View{
size12()
.accent()
.semib()
.padding1()
.border(borderColor: Color.accent)
}
func labelBG() -> some View{
size13()
.tc()
.semib()
.padding3()
.background(Color.labeBG)//paddingbackground
.radius()
}
func labelBG2() -> some View{
size13()
.tc()
.med()
.padding3()
.background(Color.labelBG2)//paddingbackground
.radius()
}
func labelPP() -> some View{
size13()
.purple()
.med()
.padding3()
.background(Color.purple.opacity(0.18))//paddingbackground
.radius()
}
func labelWA() -> some View{
size11()
.white()
.padding1()
.background(Color.accent)
.radius()
}
func labelWAL() -> some View{
size14()
.white()
.med()
.padding3()
.background(Color.accent)
.radius()
}
}