Files
yattee/Shared/Views/OpenSettingsButton.swift
Arkadiusz Fal be4e1adb9b Fix all SwiftLint violations across codebase
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>
2025-11-09 18:14:35 +01:00

39 lines
1009 B
Swift

import SwiftUI
struct OpenSettingsButton: View {
@Environment(\.presentationMode) private var presentationMode
#if !os(macOS)
private var navigation: NavigationModel { .shared }
#endif
var body: some View {
let button = Button {
presentationMode.wrappedValue.dismiss()
#if os(macOS)
NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil)
#else
navigation.presentingSettings = true
#endif
} label: {
Label("Open Settings", systemImage: "gearshape.2")
}
.buttonStyle(.plain)
// swiftlint:disable:next deployment_target
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, *) {
button
.buttonStyle(.borderedProminent)
} else {
button
}
}
}
struct OpenSettingsButton_Previews: PreviewProvider {
static var previews: some View {
OpenSettingsButton()
}
}