From ab9f5eca716de91763532af686a2c43c47742898 Mon Sep 17 00:00:00 2001 From: cheykrym Date: Wed, 10 Dec 2025 03:31:11 +0300 Subject: [PATCH] add ios 15 banner in settings --- yobble/Views/Tab/Settings/SettingsView.swift | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/yobble/Views/Tab/Settings/SettingsView.swift b/yobble/Views/Tab/Settings/SettingsView.swift index 670e902..7e84107 100644 --- a/yobble/Views/Tab/Settings/SettingsView.swift +++ b/yobble/Views/Tab/Settings/SettingsView.swift @@ -13,6 +13,12 @@ struct SettingsView: View { var body: some View { Form { + if shouldShowLegacySupportBanner { + LegacySupportBanner() + .listRowInsets(EdgeInsets(top: 12, leading: 0, bottom: 4, trailing: 0)) + .listRowBackground(Color.clear) + } + // MARK: - Профиль Section(header: Text(NSLocalizedString("Профиль", comment: ""))) { // NavigationLink(destination: EditProfileView()) { @@ -171,4 +177,41 @@ struct SettingsView: View { themeManager.setTheme(mappedTheme) } + private var shouldShowLegacySupportBanner: Bool { +#if os(iOS) + let requiredVersion = OperatingSystemVersion(majorVersion: 16, minorVersion: 0, patchVersion: 0) + return !ProcessInfo.processInfo.isOperatingSystemAtLeast(requiredVersion) +#else + return false +#endif + } +} + +private struct LegacySupportBanner: View { + var body: some View { + HStack(alignment: .top, spacing: 12) { + Image(systemName: "exclamationmark.triangle.fill") + .font(.system(size: 24, weight: .semibold)) + .foregroundColor(.yellow) + + VStack(alignment: .leading, spacing: 4) { + Text("Экспериментальная поддержка iOS 15") + .font(.headline) + Text("Поддержка iOS 15 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 16+.") + .font(.subheadline) + .foregroundColor(.secondary) + } + + Spacer(minLength: 0) + } + .padding(16) + .background( + RoundedRectangle(cornerRadius: 14, style: .continuous) + .fill(Color.yellow.opacity(0.15)) + ) + .overlay( + RoundedRectangle(cornerRadius: 14, style: .continuous) + .stroke(Color.yellow.opacity(0.4), lineWidth: 1) + ) + } }