开发者

viewWillDisappear firing before UIApplicationWillTerminateNotification

开发者 https://www.devze.com 2022-12-17 22:06 出处:网络
If I add an observer for UIApplicationWillTerminateNotification in a UIViewController, it fires after viewWillDisappear.

If I add an observer for UIApplicationWillTerminateNotification in a UIViewController, it fires after viewWillDisappear.

I have some code in the viewWillDisappear that needs to take a different action based on weather or not the application has been terminated or simply unloaded.

Can anyone suggest what开发者_C百科 could be done in this situation ?

TIA!


A crude hack, but you could add a boolean ivar which you set in applicationWillTerminate and then check it in viewWillDisappear

0

精彩评论

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

关注公众号