
class VIEwController: UIVIEwController { @IBOutlet weak var message: UILabel! @IBOutlet weak var myNotification: UILabel! overrIDe func vIEwDIDLoad() { super.vIEwDIDLoad() NSNotificationCenter.defaultCenter().addobserver(self,selector: #selector(VIEwController.updateInterface(_:)),name: UIApplicationWillEnterForegroundNotification,object: nil) } func updateInterface (notification: NSNotification){ myNotification.text = "Back to background with notification" } overrIDe func dIDReceiveMemoryWarning() { super.dIDReceiveMemoryWarning() } }@H_502_1@按下home键之后,myNotification的text永久的改为 "Back to background with notification" 总结 以上是内存溢出为你收集整理的swift程序进入后台全部内容,希望文章能够帮你解决swift程序进入后台所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)