Discussions
in iOS SDK we are getting a freeze while presenting a survey from VC, Is there any solution to this?
over 1 year ago by Mohshinsha Shahmadar
Tech Stack
Platform: iOS Swift
Version: 4.21.0
Usage: SPM
We are using a V2 method as below:
func tracking(from vc: UIViewController?) {
let eventPayload: EventPayload = .init(
eventName: "someEventName",
properties: someProps
) { [weak vc] state in
guard let viewController = vc else { return }
DispatchQueue.global(qos: .userInitiated).async {
presentSurvey(from: viewController, state: state)
}
}
UserLeapKit.Sprig.shared.track(payload: eventPayload)
}
private func myPresentSurvey(from vc: UIViewController, state: SurveyState) {
guard case .ready = state else { return }
DispatchQueue.main.async {
UserLeapKit.Sprig.shared.presentSurvey(from: vc)
}
}
Please let us know if we are missing any usage instruction or there is some recent issue in the SDK itself