Swift does not invoke the viewWillAppear method.

Asked 2 years ago, Updated 2 years ago, 273 views

Thank you for your help.

There are screen A and screen B, and screen B is placed above screen A.
When you POP screen B, use the viewWillAppear() method on screen A to
I would like to process it, but the viewWillAppear() method on screen A is
I'm at a loss for not being called.

I looked it up online and found out that
"
with a specification change from iOS 13  The viewWillAppear() method is no longer invoked."
I understand that

However, when the viewWillAppear() method on screen A is called,
I'd like to do something, but how is everyone doing it?

The source code is as follows:

override func viewWillAppear(_animated:Bool){
    presentingViewController?beginAppearanceTransition(false, animated:animated)
    super.viewWillAppear(animated)

    print("viewWillAppear was called.")
}

override func viewDidAppear(_animated:Bool){
    super.viewDidAppear(animated)
    presentingViewController?endAppearanceTransition()
    
    initializeDisplay()
    
    print("viewDidAppear was called.")
}

Thank you in advance.

swift ios uikit

2022-09-30 21:51

1 Answers

Regarding the above question, I solved it myself.

It has been resolved by the correspondence on the page below.
https://tn-works.jp/ios13-pagesheet/

Thank you.


2022-09-30 21:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.