每一个应用都会经历这几个阶段。在每个阶段完成或者过渡的时候,会调用Appdelegate中的方法。 例如,进入Background的时候会调用fun applicationDidEnterBackground(UIApplication)