{"id":3129,"date":"2021-06-08T13:26:10","date_gmt":"2021-06-08T05:26:10","guid":{"rendered":"http:\/\/123.57.164.21\/?p=3129"},"modified":"2021-06-08T13:26:10","modified_gmt":"2021-06-08T05:26:10","slug":"swift-%e5%ae%9e%e7%8e%b0%e5%a4%a7%e6%96%87%e4%bb%b6%e7%9a%84%e5%90%8e%e5%8f%b0%e4%b8%8b%e8%bd%bd%e5%8a%9f%e8%83%bd%ef%bc%88%e9%99%84%e6%a0%b7%e4%be%8b%ef%bc%89","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=3129","title":{"rendered":"Swift &#8211; \u5b9e\u73b0\u5927\u6587\u4ef6\u7684\u540e\u53f0\u4e0b\u8f7d\u529f\u80fd\uff08\u9644\u6837\u4f8b\uff09"},"content":{"rendered":"\n<p>\u00a0 \u00a0 \u6211\u4e4b\u524d\u5199\u8fc7\u4e00\u7bc7\u6587\u7ae0\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u00a0<strong>URLSession\u00a0<\/strong>\u6765\u4e0b\u8f7d\u6587\u4ef6\uff08<a rel=\"noreferrer noopener\" href=\"https:\/\/www.hangge.com\/blog\/cache\/detail_780.html\" target=\"_blank\">\u70b9\u51fb\u67e5\u770b<\/a>\uff09\uff0c\u4f46\u90fd\u662f\u524d\u53f0\u4e0b\u8f7d\u3002\u4e5f\u5c31\u662f\u8bf4\u5982\u679c\u7a0b\u5e8f\u9000\u5230\u540e\u53f0\uff08\u6bd4\u5982\u6309\u4e0b\u00a0<strong>home\u00a0<\/strong>\u952e\u3001\u6216\u8005\u5207\u5230\u5176\u5b83\u5e94\u7528\u4e0a\uff09\uff0c\u5f53\u524d\u7684\u4e0b\u8f7d\u4efb\u52a1\u4fbf\u4f1a\u7acb\u523b\u505c\u6b62\u3002<\/p>\n\n\n\n<p>\u00a0 \u00a0 \u8fd9\u6837\u5bf9\u4e8e\u4e00\u4e9b\u5927\u6587\u4ef6\u7684\u4e0b\u8f7d\u5e76\u4e0d\u53cb\u597d\uff0c\u56e0\u4e3a\u7528\u6237\u4e0d\u53ef\u80fd\u4e00\u76f4\u5f00\u7740\u00a0<strong>App\u00a0<\/strong>\u7b49\u5f85\u4e0b\u8f7d\u5b8c\u6bd5\u3002\u4e0b\u9762\u6f14\u793a\u5982\u4f55\u5728\u7a0b\u5e8f\u9000\u5230\u540e\u53f0\u65f6\uff0c\u4e0b\u8f7d\u4efb\u52a1\u4ecd\u7136\u4f1a\u7ee7\u7eed\u8fdb\u884c\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">1\uff0c\u5b9e\u73b0\u539f\u7406<\/h5>\n\n\n\n<p>\uff081\uff09<strong>URLSessionConfiguration\u00a0<\/strong>\u6709\u5982\u4e0b\u4e09\u79cd\u6a21\u5f0f\uff1a<\/p>\n\n\n\n<ul><li><strong>default<\/strong>\uff1a\u9ed8\u8ba4\u4f1a\u8bdd\u6a21\u5f0f\uff08\u4f7f\u7528\u7684\u662f\u57fa\u4e8e\u78c1\u76d8\u7f13\u5b58\u7684\u6301\u4e45\u5316\u7b56\u7565\uff09<\/li><li><strong>ephemeral<\/strong>\uff1a\u6682\u65f6\u4f1a\u8bdd\u6a21\u5f0f\uff08\u8be5\u6a21\u5f0f\u4e0d\u4f7f\u7528\u78c1\u76d8\u4fdd\u5b58\u4efb\u4f55\u6570\u636e\u3002\u800c\u662f\u4fdd\u5b58\u5728\u00a0<strong>RAM\u00a0<\/strong>\u4e2d\uff0c\u56e0\u6b64\u5f53\u7a0b\u5e8f\u4f7f\u4f1a\u8bdd\u65e0\u6548\uff0c\u8fd9\u4e9b\u7f13\u5b58\u7684\u6570\u636e\u5c31\u4f1a\u88ab\u81ea\u52a8\u6e05\u7a7a\u3002\uff09<\/li><li><strong>background<\/strong>\uff1a\u540e\u53f0\u4f1a\u8bdd\u6a21\u5f0f\uff08\u8be5\u6a21\u5f0f\u53ef\u4ee5\u5728\u540e\u53f0\u5b8c\u6210\u4e0a\u4f20\u548c\u4e0b\u8f7d\uff09<\/li><\/ul>\n\n\n\n<p>\uff082\uff09\u4e4b\u524d\u6211\u4eec\u4f7f\u7528\u7684\u90fd\u662f\u00a0<strong>default\u00a0<\/strong>\u6a21\u5f0f\uff0c\u8981\u5b9e\u73b0\u540e\u53f0\u4e0b\u8f7d\u5c31\u5fc5\u987b\u4f7f\u7528\u00a0<strong>background\u00a0<\/strong>\u6a21\u5f0f\uff1a<\/p>\n\n\n\n<ul><li>\u5f53\u00a0<strong>app\u00a0<\/strong>\u88ab\u7ec8\u6b62\u65f6\uff0c\u7cfb\u7edf\u4f1a\u63a5\u7ba1\u4e0b\u8f7d\u4efb\u52a1\u3002<\/li><li>\u7b49\u5230\u4e0b\u8f7d\u5b8c\u6210\u6216\u9700\u8981\u00a0<strong>app\u00a0<\/strong>\u5173\u6ce8\u65f6\uff0c\u7cfb\u7edf\u53c8\u4f1a\u5728\u540e\u53f0\u5524\u9192\u00a0<strong>app<\/strong>\uff08\u6ce8\u610f\u662f\u540e\u53f0\u5524\u9192\uff0c\u8be5\u00a0<strong>app\u00a0<\/strong>\u4e0d\u4f1a\u5207\u6362\u5230\u524d\u53f0\u663e\u793a\uff09\u3002<\/li><li>\u7136\u540e\u00a0<strong>app\u00a0<\/strong>\u518d\u5bf9\u4e0b\u8f7d\u6587\u4ef6\u8fdb\u884c\u540e\u7eed\u5904\u7406\u3002<\/li><\/ul>\n\n\n\n<p><strong>\u7279\u522b\u6ce8\u610f<\/strong>\uff1a\u5982\u679c\u5e94\u7528\u88ab\u5f3a\u5236\u5173\u95ed\uff08\u53cc\u51fb\u00a0<strong>home\u00a0<\/strong>\u8c03\u51fa\u540e\u53f0\u5217\u8868\uff0c\u5e76\u5c06\u5176\u4e0a\u6ed1\u5173\u95ed\uff09\uff0c\u90a3\u4e48\u540e\u53f0\u4e0b\u8f7d\u5c31\u4e0d\u518d\u8d77\u4f5c\u7528\u4e86\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">2\uff0c\u51c6\u5907\u5de5\u4f5c<\/h5>\n\n\n\n<p>\uff081\uff09\u4e3a\u65b9\u4fbf\u4f7f\u7528\uff0c\u9996\u5148\u6211\u4eec\u5c01\u88c5\u4e00\u4e2a\u540e\u53f0\u4e0b\u8f7d\u7684\u5de5\u5177\u7c7b\uff08<strong>DownloadManager.swift<\/strong>\uff09,\u5177\u4f53\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul><li>\u521b\u5efa\u4e00\u4e2a\u00a0<strong>background\u00a0session\u00a0<\/strong>\u7528\u4e8e\u540e\u53f0\u4e0b\u8f7d\uff08\u9700\u6307\u5b9a\u4e00\u4e2a\u00a0<strong>identifier<\/strong>\uff09<\/li><li>\u5b9e\u73b0\u00a0<strong>URLSessionDelegate<\/strong>\u3001<strong>URLSessionDownloadDelegate\u00a0<\/strong>\u76f8\u5173\u7684\u4ee3\u7406\u534f\u8bae\u65b9\u6cd5\uff08\u6bd4\u5982\u4e0b\u8f7d\u8fdb\u5ea6\u53cd\u9988\uff0c\u6587\u4ef6\u4e0b\u8f7d\u5b8c\u6210\u540e\u5c06\u5176\u79fb\u81f3\u7528\u6237\u6587\u6863\u76ee\u5f55\u4fdd\u5b58\uff09<\/li><\/ul>\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 \nclass DownloadManager: NSObject, URLSessionDelegate, URLSessionDownloadDelegate {\n     \n    \/\/\u5355\u4f8b\u6a21\u5f0f\n    static var shared = DownloadManager()\n     \n    \/\/\u4e0b\u8f7d\u8fdb\u5ea6\u56de\u8c03\n    var onProgress: ((Float) -> ())?\n     \n    \/\/background session\n    lazy var session:URLSession = {\n        \/\/\u53ea\u6267\u884c\u4e00\u6b21\n        let config = URLSessionConfiguration.background(withIdentifier:\n            \"background-session\")\n        let currentSession = URLSession(configuration: config, delegate: self,\n                                        delegateQueue: nil)\n        return currentSession\n    }()\n     \n    \/\/\u4e0b\u8f7d\u4ee3\u7406\u65b9\u6cd5\uff0c\u4e0b\u8f7d\u7ed3\u675f\n    func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask,\n                    didFinishDownloadingTo location: URL) {\n        \/\/\u4e0b\u8f7d\u7ed3\u675f\n        print(\"\u4e0b\u8f7d\u7ed3\u675f\")\n        if let onProgress = onProgress {\n            onProgress(1)\n        }\n         \n        \/\/\u8f93\u51fa\u4e0b\u8f7d\u6587\u4ef6\u539f\u6765\u7684\u5b58\u653e\u76ee\u5f55\n        print(\"\u4e34\u65f6\u5730\u5740:\\(location)\")\n        \/\/location\u4f4d\u7f6e\u8f6c\u6362\n        let locationPath = location.path\n        \/\/\u62f7\u8d1d\u5230\u7528\u6237\u76ee\u5f55\uff08\u6587\u4ef6\u540d\u4ee5\u65f6\u95f4\u6233\u547d\u540d\uff09\n        let fileName = date2String(Date(), dateFormat: \"yyyyMMddHHmmss\")\n        let documnets = NSHomeDirectory() + \"\/Documents\/\" + fileName + \".tmp\"\n        \/\/\u521b\u5efa\u6587\u4ef6\u7ba1\u7406\u5668\n        let fileManager = FileManager.default\n        try! fileManager.moveItem(atPath: locationPath, toPath: documnets)\n        print(\"\u6587\u4ef6\u4fdd\u5b58\u5230:\\(documnets)\")\n    }\n     \n    \/\/\u4e0b\u8f7d\u4ee3\u7406\u65b9\u6cd5\uff0c\u76d1\u542c\u4e0b\u8f7d\u8fdb\u5ea6\n    func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask,\n                    didWriteData bytesWritten: Int64, totalBytesWritten: Int64,\n                    totalBytesExpectedToWrite: Int64) {\n        \/\/\u83b7\u53d6\u8fdb\u5ea6\n        let written = (Float)(totalBytesWritten)\n        let total = (Float)(totalBytesExpectedToWrite)\n        let pro = written\/total\n        if let onProgress = onProgress {\n            onProgress(pro)\n        }\n    }\n     \n    \/\/\u4e0b\u8f7d\u4ee3\u7406\u65b9\u6cd5\uff0c\u4e0b\u8f7d\u504f\u79fb\n    func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask,\n                    didResumeAtOffset fileOffset: Int64, expectedTotalBytes: Int64) {\n        \/\/\u4e0b\u8f7d\u504f\u79fb\uff0c\u4e3b\u8981\u7528\u4e8e\u6682\u505c\u7eed\u4f20\n    }\n     \n    \/\/session\u5b8c\u6210\u4e8b\u4ef6\n    func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) {\n        \/\/\u4e3b\u7ebf\u7a0b\u8c03\u7528\n        DispatchQueue.main.async {\n            if let appDelegate = UIApplication.shared.delegate as? AppDelegate,\n                let completionHandler = appDelegate.backgroundSessionCompletionHandler {\n                appDelegate.backgroundSessionCompletionHandler = nil\n                \/\/\u8c03\u7528\u6b64\u65b9\u6cd5\u544a\u8bc9\u64cd\u4f5c\u7cfb\u7edf\uff0c\u73b0\u5728\u53ef\u4ee5\u5b89\u5168\u7684\u91cd\u65b0suspend\u4f60\u7684app\n                completionHandler()\n            }\n        }\n    }\n     \n    \/\/\u65e5\u671f -> \u5b57\u7b26\u4e32\n    func date2String(_ date:Date, dateFormat:String = \"yyyy-MM-dd HH:mm:ss\") -> String {\n        let formatter = DateFormatter()\n        formatter.locale = Locale.init(identifier: \"zh_CN\")\n        formatter.dateFormat = dateFormat\n        let date = formatter.string(from: date)\n        return date\n    }\n}<\/pre>\n\n\n\n<p>\uff082\uff09\u540c\u65f6<strong>\u00a0AppDelegate.swift\u00a0<\/strong>\u4e2d\u8981\u505a\u5982\u4e0b\u4fee\u6539\uff1a<\/p>\n\n\n\n<ul><li>\u540e\u53f0\u4e0b\u8f7d\u5b8c\u6bd5\u540e\u4f1a\u8c03\u7528\u00a0<strong>handleEventsForBackgroundURLSession\u00a0<\/strong>\u65b9\u6cd5\u3002<\/li><li>\u6211\u4eec\u5728\u6b64\u7528\u63d0\u4f9b\u7684\u00a0<strong>identifier\u00a0<\/strong>\u521b\u5efa\u65b0\u7684\u00a0<strong>URLSessionConfiguration\u00a0<\/strong>\u548c\u00a0<strong>URLSession\u00a0<\/strong>\u5bf9\u8c61\u3002<\/li><li>\u7136\u540e\u5c06\u65b0\u7684\u00a0<strong>session\u00a0<\/strong>\u5bf9\u8c61\u91cd\u65b0\u8fde\u63a5\u5230\u5148\u524d\u7684\u4efb\u52a1\uff0c\u5e76\u8c03\u7528\u76f8\u5e94\u7684\u00a0<strong>delegate<\/strong>\u3002<\/li><\/ul>\n\n\n\n<p><strong>\u6ce8\u610f<\/strong>\uff1a\u5728\u524d\u9762\u00a0<strong>DownloadManager\u00a0<\/strong>\u91cc\u7684\u00a0<strong>urlSessionDidFinishEvents()\u00a0<\/strong>\u8fd9\u4e2a\u00a0<strong>session\u00a0<\/strong>\u4ee3\u7406\u65b9\u6cd5\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u8981\u5728\u4e3b\u7ebf\u7a0b\u91cc\u8c03\u7528\u00a0<strong>AppDelegate\u00a0<\/strong>\u91cc\u4fdd\u5b58\u7684\u00a0<strong>completionHandler<\/strong>\u3002\u8fd9\u6837\u5c31\u4f1a\u544a\u8bc9\u64cd\u4f5c\u7cfb\u7edf\uff0c\u73b0\u5728\u53ef\u4ee5\u5b89\u5168\u7684\u91cd\u65b0\u00a0<strong>suspend\u00a0<\/strong>\u6211\u4eec\u7684\u00a0<strong>app\u00a0<\/strong>\u4e86\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@UIApplicationMain\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n     \n    \/\/\u7528\u4e8e\u4fdd\u5b58\u540e\u53f0\u4e0b\u8f7d\u7684completionHandler\n    var backgroundSessionCompletionHandler: (() -> Void)?\n \n    var window: UIWindow?\n     \n    \/\/\u540e\u53f0\u4e0b\u8f7d\u5b8c\u6bd5\u540e\u4f1a\u8c03\u7528\uff08\u6211\u4eec\u5c06\u5176\u4ea4\u7531\u4e0b\u8f7d\u5de5\u5177\u7c7b\u505a\u540e\u7eed\u5904\u7406\uff09\n    func application(_ application: UIApplication,\n                     handleEventsForBackgroundURLSession identifier: String,\n                     completionHandler: @escaping () -> Void) {\n         \n        \/\/\u7528\u4e8e\u4fdd\u5b58\u540e\u53f0\u4e0b\u8f7d\u7684completionHandler\n        backgroundSessionCompletionHandler = completionHandler\n         \n        \/\/\u521b\u5efadownload session\n        let configuration = URLSessionConfiguration.background(withIdentifier: identifier)\n        let downloadssession = URLSession(configuration: configuration,\n                                          delegate: DownloadManager.shared,\n                                          delegateQueue: nil)\n         \n        \/\/\u6307\u5b9adownload session\n        DownloadManager.shared.session = downloadssession\n    }\n \n    func application(_ application: UIApplication, didFinishLaunchingWithOptions\n        launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {\n        return true\n    }\n \n    func applicationWillResignActive(_ application: UIApplication) {\n    }\n \n    func applicationDidEnterBackground(_ application: UIApplication) {\n    }\n \n    func applicationWillEnterForeground(_ application: UIApplication) {\n    }\n \n    func applicationDidBecomeActive(_ application: UIApplication) {\n    }\n \n    func applicationWillTerminate(_ application: UIApplication) {\n    }\n}<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">3\uff0c\u4f7f\u7528\u6837\u4f8b<\/h5>\n\n\n\n<p>\uff081\uff09\u6837\u4f8b\u4ee3\u7801<\/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 \nclass ViewController: UIViewController {\n     \n    \/\/\u70b9\u51fb\u6309\u94ae\uff0c\u5f00\u59cb\u4e0b\u8f7d\n    @IBAction func startDownload(_ sender: Any) {\n        \/\/\u4e0b\u8f7d\u5730\u5740\n        let url = URL(string: \"https:\/\/dldir1.qq.com\/dlomg\/qqcom\/mini\/QQNewsMini5.exe\")\n        \/\/\u8bf7\u6c42\n        let request = URLRequest(url: url!)\n         \n        \/\/\u4e0b\u8f7d\u4efb\u52a1\n        let downloadTask = DownloadManager.shared.session.downloadTask(with: request)\n         \n        \/\/\u4f7f\u7528resume\u65b9\u6cd5\u542f\u52a8\u4efb\u52a1\n        downloadTask.resume()\n         \n        \/\/\u5b9e\u65f6\u6253\u5370\u51fa\u4e0b\u8f7d\u8fdb\u5ea6\n        DownloadManager.shared.onProgress = { (progress) in\n            OperationQueue.main.addOperation {\n                print(\"\u4e0b\u8f7d\u8fdb\u5ea6\uff1a\\(progress)\")\n            }\n        }\n    }\n}<\/pre>\n\n\n\n<p>\uff082\uff09\u8fd0\u884c\u6548\u679c\uff1a<\/p>\n\n\n\n<ul><li>\u70b9\u51fb\u754c\u9762\u4e0a\u7684\u6309\u94ae\u5f00\u59cb\u4e0b\u8f7d\uff0c\u53ef\u4ee5\u770b\u5230\u63a7\u5236\u53f0\u4e2d\u4e0d\u65ad\u5730\u6253\u5370\u51fa\u4e0b\u8f7d\u8fdb\u5ea6\u3002<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2021\/06\/image-24-1024x339.png\" alt=\"\" class=\"wp-image-3131\" width=\"653\" height=\"216\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-24-1024x339.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-24-300x99.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-24-768x254.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-24-830x275.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-24-230x76.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-24-350x116.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-24-480x159.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-24.png 1372w\" sizes=\"(max-width: 653px) 100vw, 653px\" \/><\/figure><\/div>\n\n\n\n<ul><li>\u6309\u4e0b\u00a0<strong>home\u00a0<\/strong>\u952e\u5c06\u5e94\u7528\u9000\u5230\u540e\u53f0\u3002\u867d\u7136\u63a7\u5236\u53f0\u4e0d\u518d\u7ee7\u7eed\u6253\u5370\u4e0b\u8f7d\u8fdb\u5ea6\uff0c\u4f46\u4e8b\u5b9e\u4e0a\u540e\u53f0\u4ecd\u5728\u7ee7\u7eed\u4e0b\u8f7d\uff0c\u5e76\u5728\u4e0b\u8f7d\u5b8c\u6bd5\u540e\u81ea\u52a8\u8c03\u7528\u76f8\u5173\u65b9\u6cd5\u3002<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2021\/06\/image-25-1024x549.png\" alt=\"\" class=\"wp-image-3132\" width=\"550\" height=\"295\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-25-1024x549.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-25-300x161.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-25-768x412.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-25-830x445.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-25-230x123.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-25-350x188.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-25-480x257.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2021\/06\/image-25.png 1160w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 \u6211\u4e4b\u524d\u5199\u8fc7\u4e00\u7bc7\u6587\u7ae0\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u00a0URLSession\u00a0\u6765\u4e0b\u8f7d\u6587\u4ef6\uff08\u70b9\u51fb\u67e5\u770b\uff09\uff0c\u4f46\u90fd\u662f\u524d\u53f0\u4e0b\u8f7d\u3002\u4e5f\u5c31\u662f\u8bf4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,8],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/3129"}],"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=3129"}],"version-history":[{"count":2,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/3129\/revisions"}],"predecessor-version":[{"id":3133,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/3129\/revisions\/3133"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}