mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 21:36:17 +00:00
cleaned up viewmodifier
This commit is contained in:
@@ -9,19 +9,15 @@ import Foundation
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct foregroundColorStyle: ViewModifier {
|
struct foregroundColorStyle: ViewModifier {
|
||||||
var color: Color?
|
var color: Color
|
||||||
|
|
||||||
init(_ color: Color?) {
|
init(_ color: Color) {
|
||||||
self.color = color
|
self.color = color
|
||||||
}
|
}
|
||||||
|
|
||||||
func body(content: Content) -> some View {
|
func body(content: Content) -> some View {
|
||||||
if #available(iOS 17.0, *) {
|
if #available(iOS 15.0, *) {
|
||||||
if let color = color {
|
|
||||||
content.foregroundStyle(color)
|
content.foregroundStyle(color)
|
||||||
} else {
|
|
||||||
content
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
content.foregroundColor(color)
|
content.foregroundColor(color)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user