mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 13:12:53 +00:00
Delete declarations that Periphery reports unused on every platform that compiles them (iOS, macOS, tvOS), including nine views used only by their own previews. Platform-gated code still used on another platform, device- only MPV render paths, migration models, CloudKit record names, App Intents metadata and unused parameters are kept.
28 lines
853 B
Swift
28 lines
853 B
Swift
//
|
|
// 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
|