iOS开发之监听应用进入前台后台

定格 2019-12-11

//后台进前台通知 UIApplicationDidBecomeActiveNotification
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil];

//进入后台UIApplicationDidEnterBackgroundNotification
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil];

我们

相关推荐