Submit and Save PDF Forms to Custom Destinations
PDFViewController
provides a PDFFormSubmissionDelegate
, which can be used to receive information about an ongoing form submission. This allows for the customization of the submit action and also gives feedback on the ongoing HTTP request.
When a form submission action is run, the delegate will receive the following callbacks in order:
-
formSubmissionControllerShouldPresentResponseinWebView(_:)
: — Should the view controller push a web view with the response data? If yes, then the web view takes responsibility for the connection and the delegates from point 4 below won’t be called. -
formSubmissionController(_:shouldSubmitFormRequest:)
: — If no, then the operation is canceled. -
formSubmissionController(_:willSubmitFormValues:)
: — The submission is going ahead. -
Depending on whether or not the submission is successful, one of the following will be called:
-
formSubmissionController(_:didReceiveResponseData:)
: — The submission has completed successfully. -
formSubmissionController(_:didFailWithError:)
: — The submission has failed.
-