import Foundation #if canImport(SwiftUI) import SwiftUI #endif #if canImport(CoreGraphics) import CoreGraphics #endif #if canImport(UIKit) import UIKit #endif #if !canImport(UIKit) struct UIDevice { static let topNotch: CGFloat = 0 static let bottomNotch: CGFloat = 0 var modelName: String { "android" } } #endif #if !(canImport(LCEssentials) && os(iOS)) func printLog(title: String, msg: String) { print("[\(title)] \(msg)") } func printError(title: String, msg: String) { print("[\(title)] \(msg)") } #endif extension View { @ViewBuilder func appInlineNavigationTitle() -> some View { #if os(macOS) self #else self.navigationBarTitleDisplayMode(.inline) #endif } @ViewBuilder func appHiddenNavigationBar() -> some View { #if os(macOS) self #else self .toolbar(.hidden, for: .navigationBar) .toolbarBackground(.hidden, for: .navigationBar) #endif } @ViewBuilder func appTopBarTrailingToolbar(@ViewBuilder content: () -> Content) -> some View { #if os(macOS) self.toolbar { ToolbarItem { content() } } #else self.toolbar { ToolbarItem(placement: .topBarTrailing) { content() } } #endif } }