RTSDA-iOS/Extensions/Color+tvOS.swift
RTSDA 00679f927c docs: Update README for v2.0 release and fix git remote URL
- Comprehensive README update documenting v2.0 architectural changes
- Updated git remote to ssh://rockvilleav@git.rockvilletollandsda.church:10443/RTSDA/RTSDA-iOS.git
- Documented unified ChurchService and 60% code reduction
- Added new features: Home Feed, responsive reading, enhanced UI
- Corrected license information (GPL v3 with church content copyright)
- Updated build instructions and technical stack details
2025-08-16 18:41:51 -04:00

85 lines
2.1 KiB
Swift

import SwiftUI
import UIKit
// MARK: - Global tvOS Compatibility
#if os(tvOS)
// Add missing system colors for tvOS
extension UIColor {
static var systemBackground: UIColor { return UIColor.black }
static var secondarySystemBackground: UIColor { return UIColor.gray.withAlphaComponent(0.1) }
static var systemGray6: UIColor { return UIColor.gray.withAlphaComponent(0.2) }
}
// Dummy UIActivityViewController for tvOS
class UIActivityViewController: UIViewController {
convenience init(activityItems: [Any], applicationActivities: [UIActivity]?) {
self.init()
}
}
// Add missing NavigationBarItem types
extension NavigationBarItem {
enum TitleDisplayMode {
case automatic
case inline
case large
}
}
#endif
// MARK: - SwiftUI Extensions
extension Color {
static var systemBackground: Color {
#if os(iOS)
return Color(.systemBackground)
#else
return Color.black
#endif
}
static var secondarySystemBackground: Color {
#if os(iOS)
return Color(.secondarySystemBackground)
#else
return Color.secondary.opacity(0.1)
#endif
}
static var systemGray6: Color {
#if os(iOS)
return Color(.systemGray6)
#else
return Color.gray.opacity(0.2)
#endif
}
}
// MARK: - View Extensions for tvOS Compatibility
extension View {
func navigationBarTitleDisplayMode(_ mode: NavigationBarItem.TitleDisplayMode) -> some View {
#if os(iOS)
return self.navigationBarTitleDisplayMode(mode)
#else
return self
#endif
}
func navigationBarBackButtonHidden(_ hidden: Bool) -> some View {
#if os(iOS)
return self.navigationBarBackButtonHidden(hidden)
#else
return self
#endif
}
func listRowSeparator(_ visibility: Visibility, edges: VerticalEdge.Set = .all) -> some View {
#if os(iOS)
return self.listRowSeparator(visibility, edges: edges)
#else
return self
#endif
}
}