ios – Presenting view controllers with a queue


let vc = AppAlertViewController()
vc.alertModel = model
sheetTransitionDelegate = SheetTransitioningDelegate(isDismissableWithoutButton: model.isDismissableWithoutButton)
delegates.append(sheetTransitionDelegate)
vc.modalPresentationStyle = .custom
vc.transitioningDelegate = sheetTransitionDelegate
guard let topVc = UIApplication.getTopViewController() else { return nil }
topVc.present(vc, animated: true)

I am displaying a view controller containing a custom transition delegate with the code provided above. In some cases, this code is called consecutively, and as a result, I receive the following error because the animation from the previous one has not yet completed:

Attempt to present <app.AppAlertViewController: 0x132106600> on <UINavigationController: 0x132821800> (from <UINavigationController: 0x132821800>) which is already presenting <app.AppAlertViewController: 0x13204f000>

If this code is called consecutively and the animation has not yet completed, how can I queue them up and display others sequentially after the animation has finished?

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img