-2

When i close to UiPageVC, after UiPageVC's viewWillDisappear call, ChildVC's viewWillAppear and viewDidAppear function calls. At the end, UiPageVC's viewDidDisappear works.

I need to work ChildVC like normal way. When i dismiss to UiPageVC, viewWillDisappear and viewDidDisappear of ChildVC should call.

  • Can you create a [mcve] - preferably as a small downloadable project? It may be that there's some other mistake going on here. – matt Aug 17 '20 at 17:03

1 Answers1

2

According to this answer, viewWillDisappear(_:) & viewDidDisappear(_:) might not get called in child view controller.

Following Apple's Doc, override viewWillDisappear(_:) & viewDidDisappear(_:) in UIPageViewController subclass.

override func viewWillDisappear(_ animated: Bool) {
    super.viewWillAppear(animated)
    children.forEach { $0.beginAppearanceTransition(false, animated: true) }
}
override func viewDidDisappear(_ animated: Bool) {
    super.viewDidDisappear(animated)
    children.forEach { $0.endAppearanceTransition() }
}
Sauvik Dolui
  • 5,520
  • 3
  • 34
  • 44