Sadly I haven’t got Qualtrics put in, however I’ve labored with it inside UIKit. My assumption right here is that you will want to create an occasion of a UIViewController. This view controller is what the qualtrics view will current itself over.

Finally, you’ll return the view controller which comprises the qualtrics view offered over it.

struct QualtricsViewRep: UIViewControllerRepresentable {
     typealias UIViewControllerType = UIViewController

     func makeUIViewController(context: Context) -> UIViewController {
         let vc = UIViewController()
            Qualtrics.shared.evaluateProject { (targetingResults) in
                for (interceptID, outcome) in targetingResults {
                    if outcome.handed() {
                        let vc = UIViewController()
                        let displayed = Qualtrics.shared.show(viewController: vc, autoCloseSurvey: true)
                    }
                }
            }
         return vc
     }

     func updateUIViewController(_ uiViewController: UIViewController, context: Context) {
         // your code right here
     }
}

By admin

Leave a Reply

Your email address will not be published.