开发者

Sequencing issue between viewWillAppear & viewWillDisappear

开发者 https://www.devze.com 2023-03-18 23:47 出处:网络
I am facing a strange issue: When I am switching from one view controller to another view controller, my viewWillDisappear of first VC gets called and then viewWillAppear of second view controller ge

I am facing a strange issue:

When I am switching from one view controller to another view controller, my viewWillDisappear of first VC gets called and then viewWillAppear of second view controller gets called.

This is the correct sequence and my app behaves fine but when I share my app with some other app and present my app as a modal from that app then within my app when I do the above mentioned transition, viewWillAppear of second view controller gets called first and then viewWillDisappear of first view controlle开发者_如何学运维r gets called. This creates a problem.

Can someone help me understanding why this different behavior? I am enabling a functionality in viewWillAppear and disabling it in viewWillDisappear, so in second case I always end up disabling the functionality.


I sorted out by changing the sequence... Like I am enabling the Feature in viewDidAppear but disabling it in viewWillDisappear.

0

精彩评论

暂无评论...
验证码 换一张
取 消