WatchOS系统开发大全(4)-WatchApp生命周期

2017-07-27  本文已影响73人  坤小

WatchOSAPP生命周期

1.1-简介

0700.png

1.2-API


    //应用加载时会调用
    func applicationDidFinishLaunching() {
        // Perform any final initialization of your application.
        print(__FUNCTION__)
    }
    
    //应用激活时会调用(进入前台)
    func applicationDidBecomeActive() {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
        print(__FUNCTION__)
    }
    
    //应用失活时会调用(退到后台)
    func applicationWillResignActive() {
        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
        // Use this method to pause ongoing tasks, disable timers, etc.
        print(__FUNCTION__)
    }

上一篇 下一篇

猜你喜欢

热点阅读