我有一段代码在 iPhone 上运行良好,但在 iPad 上却不行。就像窗户在那里但不可见......
func userDidTapShare()
{
print("Share")
let mediaURL = URL(fileURLWithPath: Constants.Path.mainFolder.stringByAppendingPathComponent(path:mediaPath))
let activityItems: [Any] = [mediaURL, "Check this out!"]
let activityVC = UIActivityViewController(activityItems: activityItems, applicationActivities: nil)
activityVC.popoverPresentationController?.sourceView = self.view
activityVC.popoverPresentationController?.sourceRect = view.frame
self.present(activityVC, animated: true, completion: nil)
}
iPad 上不显示该窗口。
任何想法?