When a UIActivityViewController is called on the iPhone in this app, it works perfectly, but when called on a iPad, the app crashes. Below is the code I used:
I added for Swift 3:
activityViewController.popoverPresentationController?.sourceView = self.view
fixed my issue.