// // ShareSheet.swift // Yattee // // Cross-platform share sheet for exporting content. // import SwiftUI #if os(iOS) struct ShareSheet: UIViewControllerRepresentable { let items: [Any] func makeUIViewController(context: Context) -> UIActivityViewController { let controller = UIActivityViewController(activityItems: items, applicationActivities: nil) // On iPad the activity sheet is presented as a popover and requires an // anchor; without one UIKit aborts in presentationTransitionWillBegin. if let popover = controller.popoverPresentationController { popover.sourceView = controller.view popover.permittedArrowDirections = [] } return controller } func updateUIViewController(_ uiViewController: UIActivityViewController, context: Context) {} } #endif