{"id":2455,"date":"2021-04-23T14:07:53","date_gmt":"2021-04-23T06:07:53","guid":{"rendered":"http:\/\/123.57.164.21\/?p=2455"},"modified":"2021-04-23T14:07:53","modified_gmt":"2021-04-23T06:07:53","slug":"ios-app-%e4%bb%8e%e5%90%8e%e5%8f%b0%e5%bc%ba%e5%88%b6%e5%85%b3%e9%97%ad%e6%97%b6-%e8%a7%a6%e5%8f%91%e7%9a%84%e9%80%bb%e8%be%91","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=2455","title":{"rendered":"IOS App \u4ece\u540e\u53f0\u5f3a\u5236\u5173\u95ed\u65f6 \u89e6\u53d1\u7684\u903b\u8f91"},"content":{"rendered":"\n<p>\u6709\u7684\u65f6\u5019\uff0c\u5f53App\u4ece\u4efb\u52a1\u7ba1\u7406\u5668\u88ab\u5f3a\u5236\u5173\u95ed\u65f6\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u548c\u670d\u52a1\u5668\u901a\u4fe1\uff0c\u6216\u8005\u5199Log\u6587\u4ef6\u7b49\u7b49\uff0c\u8fd9\u65f6\u5019\u53ef\u4ee5\u5728applicationWillTerminate\u4e2d\u505a\u8fd9\u4e2a\u4e8b\u60c5\u3002\u53ef\u4ee5\u5728\u5f88\u77ed\u6682\u7684\u65f6\u95f4\uff0c\u505a\u4e9b\u4e8b\u60c5\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import UIKit\n\n@main\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {\n        \/\/ Override point for customization after application launch.\n        UNUserNotificationCenter.current().delegate = self\n        return true\n    }\n\n    \/\/ MARK: UISceneSession Lifecycle\n\n    func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {\n        \/\/ Called when a new scene session is being created.\n        \/\/ Use this method to select a configuration to create the new scene with.\n        return UISceneConfiguration(name: \"Default Configuration\", sessionRole: connectingSceneSession.role)\n    }\n\n    func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set&lt;UISceneSession>) {\n        \/\/ Called when the user discards a scene session.\n        \/\/ If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.\n        \/\/ Use this method to release any resources that were specific to the discarded scenes, as they will not return.\n    }\n\n    func applicationWillTerminate(_ application: UIApplication) {\n        \/\/ \u670d\u52a1\u5668\u901a\u4fe1\u6216\u8005\u5199\u6587\u4ef6\u3002\n        HttpService.xxxx() { _ in }\n        \/\/ \u203bSleep4\u79d2 \u4e0d\u52a0\u8fd9\u4e2a\u4e0d\u597d\u7528\n        sleep(4)\n    }\n\n}<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u7684\u65f6\u5019\uff0c\u5f53App\u4ece\u4efb\u52a1\u7ba1\u7406\u5668\u88ab\u5f3a\u5236\u5173\u95ed\u65f6\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u548c\u670d\u52a1\u5668\u901a\u4fe1\uff0c\u6216\u8005\u5199Log\u6587\u4ef6\u7b49\u7b49\uff0c\u8fd9\u65f6\u5019\u53ef\u4ee5\u5728app [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,8],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/2455"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2455"}],"version-history":[{"count":2,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/2455\/revisions"}],"predecessor-version":[{"id":2457,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/2455\/revisions\/2457"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}