Closed bishalg closed 8 years ago
We can fix this issue if we add
activityViewController.popoverPresentationController?.sourceView = self.view
to the RootViewController.swift
extension RootViewController: OCKConnectViewControllerDelegate {
/// Called when the user taps a contact in the `OCKConnectViewController`.
func connectViewController(connectViewController: OCKConnectViewController, didSelectShareButtonForContact contact: OCKContact, presentationSourceView sourceView: UIView) {
let document = sampleData.generateSampleDocument()
let activityViewController = UIActivityViewController(activityItems: [document], applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = sourceView
presentViewController(activityViewController, animated: true, completion: nil)
}
}
Pull Request - #25
@bishalg Should we have a separate target for iPad to avoid any issues (such as HealthKit not being available on iPad)?
Having a separate target for iPad is a overkill for simple app provided. The CareKit framework itself is compatible for both iPhone and iPad. Sample App does not need to use HealthKit features and in fact OCKSample
does not use HealthKit feature as of now. Hence I believe the OCKSample
should be device independent.
@bishalg I agree. Good to go with the #25 then! 👍
Right now the sample app -
OCKSample
is iPhone only application. Which can be change to support iPad as well. App looks okay and runs fine, but crashes on "Connect
" screen when we try to share via "Send Report" It give following error -*** Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController (<_UIAlertControllerActionSheetRegularPresentationController:>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.'