| 12345678910111213141516171819202122232425262728293031323334353637 |
- import SwiftUI
- import UIKit
- enum CompatibleSymbol {
- static func name(_ name: String, fallback: String) -> String {
- UIImage(systemName: name) == nil ? fallback : name
- }
- }
- extension View {
- @ViewBuilder func jokerNavigationBarBackground() -> some View {
- if #available(iOS 16, *) {
- toolbarBackground(.white, for: .navigationBar).toolbarBackground(.visible, for: .navigationBar)
- } else { self }
- }
- @ViewBuilder func jokerThemePresentation() -> some View {
- if #available(iOS 16, *) {
- presentationDetents([.height(240)]).presentationDragIndicator(.visible)
- } else { self }
- }
- #if DEBUG
- @ViewBuilder func jokerPreviewScrollAnchor(atBottom: Bool) -> some View {
- if #available(iOS 17, *) { defaultScrollAnchor(atBottom ? .bottom : .top) }
- else { self }
- }
- #endif
- }
- struct FeedbackShareSheet: UIViewControllerRepresentable {
- let text: String
- func makeUIViewController(context: Context) -> UIActivityViewController {
- UIActivityViewController(activityItems: [text], applicationActivities: nil)
- }
- func updateUIViewController(_ controller: UIActivityViewController, context: Context) { }
- }
|