cleaned up viewmodifier

This commit is contained in:
neon443 committed 2025-06-09 13:43:21 +01:00
1 parent 9410774264
commit 73e31b26f2
1 file changed
+4 -8
+4 -8
View File
@@ -9,19 +9,15 @@ import Foundation
import SwiftUI
struct foregroundColorStyle: ViewModifier {
var color: Color?
var color: Color
init(_ color: Color?) {
init(_ color: Color) {
self.color = color
}
func body(content: Content) -> some View {
if #available(iOS 17.0, *) {
if let color = color {
content.foregroundStyle(color)
} else {
content
}
if #available(iOS 15.0, *) {
content.foregroundStyle(color)
} else {
content.foregroundColor(color)
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.