SDK Reference v2.0.0 / SurveyViewController

SurveyViewController

final class SurveyViewController : UIViewController

Presents a MyDataHelps survey for the participant to complete. This view controller implements the complete user experience for a MyDataHelps survey, including step navigation and sending results to MyDataHelps, and is intended for modal presentation.

See Presenting Surveys for a detailed guide to using SurveyViewController.

SurveyViewController is not intended for subclassing.


SurveyResult
enum MyDataHelpsKit.SurveyViewController.SurveyResult : String

Describes how a participant completed interaction with a survey.

See SurveyViewController for usage; note that your app must dismiss the SurveyViewController in all result cases.

presentation
let presentation: SurveyPresentation

Information about the survey being presented to the participant.

init(presentation: completion:)
init(presentation: SurveyPresentation, completion: @escaping (SurveyViewController, Result<SurveyResult, MyDataHelpsError>) -> Void)

Initializes a SurveyViewController that presents a given survey to a participant.

presentation

Information about the survey being presented to the participant. Construct this using ParticipantSession.surveyPresentation(surveyName:).

completion

Called when the participant has completed interaction with the survey. The completion callback must always dismiss the SurveyViewController.