swift -> App挂起 (HOME到主屏幕) 和 返回到App 监听
//挂起APP, 即 Home 键 监听 NotificationCenter.default.addObserver(self, selector:#selector(willResionActive),name: NSNotification.Name.UIApplicationWillResignActive,object: nil); //重回app 监听 NotificationCenter.default.addObserver(self, selector:#selector(didBecome),name: NSNotification.Name.UIApplicationDidBecomeActive,object: nil);
//挂起app 监听 func willResionActive(){ print("app will hide") } //重新回到app 监听 func didBecome(){ print("didi become") }
相关推荐
liuxudong00 2020-11-19
wwzaqw 2020-11-11
lihaoxiang 2020-11-05
CrossingX 2020-11-04
xuegangic 2020-10-17
86417413 2020-11-25
83206733 2020-11-19
86276537 2020-11-19
83266337 2020-11-19
86256434 2020-11-17
zhouboxiao 2020-11-16
rise 2020-11-22
sssdssxss 2020-11-20
windle 2020-11-10
孙雪峰 2020-10-30
85477104 2020-11-17
xfcyhades 2020-11-20
cheidou 2020-11-19