UIActivityViewController stürzt auf iPad mit iOS 8 ab: Crash beim Anzeigen
Hallo zusammen! Ich entwickle eine iOS-App in Swift und bin auf ein Problem gestoßen: Mein UIActivityViewController stürzt auf dem iPad mit iOS 8 ständig ab, obwohl auf dem iPhone alles einwandfrei funktioniert. Hier ist mein Code:
```swift
let textToShare = "Diesen Text teilen"
let activityVC = UIActivityViewController(activityItems: [textToShare], applicationActivities: nil)
presentViewController(activityVC, animated: true, completion: nil)
```
Auf dem iPhone wird der Controller modal angezeigt, und alles ist in Ordnung. Aber auf dem iPad (z.B. iPad Air mit iOS 8.1) stürzt die App mit folgendem Fehler ab:
```
*** Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController should have a non-nil sourceView or barButtonItem set before the presentation occurs.'
```
Ich habe gelesen, dass auf dem iPad UIActivityViewController als Popover und nicht modal angezeigt wird und man eine Quelle angeben muss – sourceView oder barButtonItem. Aber ich verstehe nicht, wie man das in Swift richtig macht. Ich habe versucht, `activityVC.popoverPr