PSPDFFormSubmissionDelegate

@protocol PSPDFFormSubmissionDelegate <NSObject>

Delegate for form submission actions. When a form submission action is run, the delegate will be queried in this order: 1. formSubmissionController:shouldPresentWebViewForResponseData: – should the view controller push a web view with the response data. If yes then the web view takes responsibility for the connection and call 4 is not made. 2. formSubmissionController:shouldSubmitFormValues: – if no then the operation is cancelled. 3. formSubmissionController:willSubmitFormValues: – the submission is going ahead. 4.a formSubmissionController:didReceiveResponseData: – the submission has completed successfully OR 4.b formSubmissionController:didFailWithError: – the submission has failed

  • The user has activated a submission action, return to indicate whether it should be sent. Defaults to YES if not implemented.

    Declaration

    Objective-C

    - (BOOL)formSubmissionController:
                (nonnull PSPDFFormSubmissionController *)formSubmissionController
             shouldSubmitFormRequest:(nonnull PSPDFFormRequest *)formRequest;

    Swift

    optional func formSubmissionController(_ formSubmissionController: PSPDFFormSubmissionController, shouldSubmitFormRequest formRequest: PSPDFFormRequest) -> Bool
  • The user has activated a submission action, which will go ahead.

    Declaration

    Objective-C

    - (void)formSubmissionController:
                (nonnull PSPDFFormSubmissionController *)formSubmissionController
                willSubmitFormValues:(nonnull PSPDFFormRequest *)formRequest;

    Swift

    optional func formSubmissionController(_ formSubmissionController: PSPDFFormSubmissionController, willSubmitFormValues formRequest: PSPDFFormRequest)
  • The submission connection has succeeded and the server has responded with the given data.

    Declaration

    Objective-C

    - (void)formSubmissionController:
                (nonnull PSPDFFormSubmissionController *)formSubmissionController
              didReceiveResponseData:(nonnull NSData *)responseData;

    Swift

    optional func formSubmissionController(_ formSubmissionController: PSPDFFormSubmissionController, didReceiveResponseData responseData: Data)
  • The submission has failed with an error.

    Declaration

    Objective-C

    - (void)formSubmissionController:
                (nonnull PSPDFFormSubmissionController *)formSubmissionController
                    didFailWithError:(nonnull NSError *)error;

    Swift

    optional func formSubmissionController(_ formSubmissionController: PSPDFFormSubmissionController, didFailWithError error: Error)
  • If YES is returned then a web view containing the response data will be shown. Defaults to YES if not implemented.

    Declaration

    Objective-C

    - (BOOL)formSubmissionControllerShouldPresentResponseInWebView:
        (nonnull PSPDFFormSubmissionController *)formSubmissionController;

    Swift

    optional func formSubmissionControllerShouldPresentResponse(inWebView formSubmissionController: PSPDFFormSubmissionController) -> Bool