mirror of
https://github.com/yattee/yattee.git
synced 2025-11-12 21:28:42 +00:00
Resolves 130+ violations including deployment target checks, code style issues, and formatting inconsistencies. Adds SwiftLint disable comments for compiler-required availability checks while maintaining deployment target compliance. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
29 lines
849 B
Swift
29 lines
849 B
Swift
import Foundation
|
|
import SwiftUI
|
|
|
|
struct ControlBackgroundModifier: ViewModifier {
|
|
var enabled = true
|
|
var edgesIgnoringSafeArea = Edge.Set()
|
|
|
|
func body(content: Content) -> some View {
|
|
if enabled {
|
|
// swiftlint:disable:next deployment_target
|
|
if #available(iOS 15, macOS 12, *) {
|
|
content
|
|
.background(.thinMaterial)
|
|
} else {
|
|
content
|
|
#if os(macOS)
|
|
.background(VisualEffectBlur(material: .hudWindow))
|
|
#elseif os(iOS)
|
|
.background(VisualEffectBlur(blurStyle: .systemThinMaterial).edgesIgnoringSafeArea(edgesIgnoringSafeArea))
|
|
#else
|
|
.background(.thinMaterial)
|
|
#endif
|
|
}
|
|
} else {
|
|
content
|
|
}
|
|
}
|
|
}
|