Swift

Swift - modal 여러 개 한 번에 dismiss 하기

Goniii 2024. 11. 20. 19:55

📑 학습 내용

  • 화면 전환을 모달 방식으로 여러번 한 후, 한 번에 dismiss 하는 방법
    • presentingViewController : 현재 뷰를 띄운 뷰 컨트롤러
    self.presentingViewController?.presentingViewController?.dismiss(animated: true)

→ presentingViewController 를 여러번 사용하여 이전 뷰 컨트롤러를 사용 가능함

📚 참고 자료

 

[Swift/iOS] modal 2개 한번에 dismiss하기

이렇게 한번에 모달창 두개를 dismiss 하는 방법은로 구현할 수 있습니다~참고https://stackoverflow.com/questions/54266115/how-to-dismiss-2-modal-view-controllers-without-weird-a

velog.io

 

 

presentingViewController | Apple Developer Documentation

The view controller that presented this view controller.

developer.apple.com