viewDidAppear not triggered automatically in iOS 13 beta

Hello,


I am overriding the viewDidAppear in my views and adding some functionality in it.


I am presing child ViewControllers with present and when returning to previous view controller I am using dismiss.


The viewDidAppear is called each time in iOS 12 after dismissing a child view.


In iOS 13 beta this is not happening. View did appear is called only when view is loaded.


Any suggestion would be helpful here.


I am usning Swift 5.


Thanks.


Bogdan

Replies

Probably because the view is not inserted in the view hierachy (already there).

This may help:

h ttps://medium.com/livefront/why-isnt-viewwillappear-getting-called-d02417b00396


Are you sure of the difference with IOS12 ?


Interesting discussion here:

https://stackoverflow.com/questions/11532808/viewdidappear-not-getting-called

Thanks !


Yes, I check with several iOS devices running iOS 12 and simulators and all of them work fine.


It seems that issue is just with iOS 13 beta.

Could you show the code where you present and where you dismiss ?


In fact, as you present as modal, the original view does not disappear ; hence, does not call willAppear when other is dismissed.


Not sure why it's different between IOS 12 and 13.


But you could insert what you need executed (from viewDidAppear) in the completion handler of dismiss


dismiss(animated: true, completion: {
    // Code copied from viewDidAppear
})