Код: Выделить всё
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
@IBAction func didTapShare(_ sender: UIButton) {
let activity = UIActivityViewController(activityItems: ["banana"], applicationActivities: nil)
if UIDevice.current.userInterfaceIdiom == .pad {
activity.modalPresentationStyle = .formSheet
// activity.preferredContentSize = CGSize(width: 400, height: 400)
}
present(activity, animated: true, completion: nil)
}
}
< /code>
Это, конечно, сбои < /p>
"UIPopoverPresentationController () should have a non-nil sourceView or barButtonItem set before the presentation occurs."
Подробнее здесь: https://stackoverflow.com/questions/675 ... et-on-ipad