{"id":20087928,"url":"https://github.com/libobjc/sgdownload","last_synced_at":"2025-09-11T06:33:02.041Z","repository":{"id":202173852,"uuid":"85305750","full_name":"libobjc/SGDownload","owner":"libobjc","description":"A delightful big files download framework for iOS, OS X, watchOS, and tvOS.","archived":false,"fork":false,"pushed_at":"2019-06-15T07:22:11.000Z","size":142,"stargazers_count":164,"open_issues_count":5,"forks_count":26,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-06T02:39:20.113Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libobjc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-03-17T11:44:19.000Z","updated_at":"2025-04-30T09:18:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"40d3d964-9437-45f5-92fd-9aea580107b9","html_url":"https://github.com/libobjc/SGDownload","commit_stats":null,"previous_names":["libobjc/sgdownload"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/libobjc/SGDownload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libobjc%2FSGDownload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libobjc%2FSGDownload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libobjc%2FSGDownload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libobjc%2FSGDownload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libobjc","download_url":"https://codeload.github.com/libobjc/SGDownload/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libobjc%2FSGDownload/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274589551,"owners_count":25312971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T16:10:23.949Z","updated_at":"2025-09-11T06:33:02.013Z","avatar_url":"https://github.com/libobjc.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SGDownload\n\nSGDownload 是一个文件下载器。非常适合用于视频下载，支持后台，锁屏下载。同时支持 iOS、macOS、tvOS 三个平台。\n\n\n## 功能特点\n\n- 使用 NSCondition 条件变量控制并发数、调度下载任务。\n- 封装任务队列（block queue）来管理下载任务。\n- 如下载过程中 App 崩溃，已唤醒的任务继续下载，并在下次启动 App 时同步状态。\n\n\n## 使用示例\n\n```obj-c\n\n// 在 AppDelegate 中添加如下代码。\n- (void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)())completionHandler\n{\n    [SGDownload handleEventsForBackgroundURLSession:identifier completionHandler:completionHandler];\n}\n\n// 启动下载\nself.download = [SGDownload download];\n[self.download run];\nSGDownloadTask * task = [self.download taskWithContentURL:contentURL];\nif (!task)\n{\n    task = [SGDownloadTask taskWithTitle:@“title”\n                              contentURL:contentURL\n                                 fileURL:fileURL];\n}\n[self.download addDownloadTask:task];\n\n```\n\n\n## 效果演示\n\n### iOS\n\n![iOS 效果演示](https://github.com/libobjc/resource/blob/master/SGDownload/SGDownload-iOS.gif?raw=true)\n\n### macOS\n\n![macOS 效果演示](https://github.com/libobjc/resource/blob/master/SGDownload/SGDownload-macOS.gif?raw=true)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibobjc%2Fsgdownload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibobjc%2Fsgdownload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibobjc%2Fsgdownload/lists"}