{"id":45245353,"url":"https://github.com/huxinguang/xgimagepickercontroller","last_synced_at":"2026-02-20T22:03:25.391Z","repository":{"id":56927953,"uuid":"156310981","full_name":"huxinguang/XGImagePickerController","owner":"huxinguang","description":"iOS相册图片/视频选择器","archived":false,"fork":false,"pushed_at":"2018-12-22T12:42:29.000Z","size":6859,"stargazers_count":38,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-17T11:18:45.721Z","etag":null,"topics":["assetpicker","assetpickercontroller","camera","imagepicker","imagepickercontroller","ios","picker"],"latest_commit_sha":null,"homepage":null,"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/huxinguang.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}},"created_at":"2018-11-06T01:59:53.000Z","updated_at":"2025-05-28T02:31:56.000Z","dependencies_parsed_at":"2022-08-21T04:20:54.974Z","dependency_job_id":null,"html_url":"https://github.com/huxinguang/XGImagePickerController","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/huxinguang/XGImagePickerController","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huxinguang%2FXGImagePickerController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huxinguang%2FXGImagePickerController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huxinguang%2FXGImagePickerController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huxinguang%2FXGImagePickerController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huxinguang","download_url":"https://codeload.github.com/huxinguang/XGImagePickerController/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huxinguang%2FXGImagePickerController/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29666462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T19:49:36.704Z","status":"ssl_error","status_checked_at":"2026-02-20T19:44:05.372Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["assetpicker","assetpickercontroller","camera","imagepicker","imagepickercontroller","ios","picker"],"created_at":"2026-02-20T22:03:10.730Z","updated_at":"2026-02-20T22:03:25.373Z","avatar_url":"https://github.com/huxinguang.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"XGAssetPickerController_logo.png\" title=\"XGAssetPickerController logo\" float=left\u003e\n\u003c/p\u003e\n\n功能描述\n==============\n`XGAssetPickerController`是一款iOS相册选择器，支持图片、视频拍摄，多图片、多视频混选及预览， 支持Gif浏览(`iOS11+`)，多个相册目录同一图片/视频可自动排重，并具有记录已选图片/视频的功能。\n\n\n系统要求\n==============\n该项目最低支持 `iOS 8.0+`。\n\n演示项目\n==============\n1. 命令行进入`Demo`文件夹路径下，并执行`pod install`\n2. 打开`XGAssetPickerController-Demo.xcworkspace`\n\n\u003cdiv style=\"width:960px;overflow-x:scroll\"\u003e\n\u003cdiv style=\"width:2001px\"\u003e\n\u003cimg src=\"demo_sample1.png\" width=\"187.5\" height=\"333.5\"/\u003e\n\u003cimg src=\"demo_sample2.png\" width=\"187.5\" height=\"333.5\" /\u003e\n\u003cimg src=\"demo_sample3.png\" width=\"187.5\" height=\"333.5\"/\u003e\n\u003c/div\u003e\n\u003cdiv style=\"width:2001px\"\u003e\n\u003cimg src=\"demo_sample4.png\" width=\"187.5\" height=\"333.5\"/\u003e\n\u003cimg src=\"demo_sample5.png\" width=\"187.5\" height=\"333.5\" /\u003e\n\u003cimg src=\"demo_sample6.png\" width=\"187.5\" height=\"333.5\"/\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n安装\n==============\n\n### CocoaPods\n\n1. 在 `Podfile` 中添加  `pod 'XGAssetPickerController'`。\n2. 执行 `pod install` 或 `pod update`。\n3. `#import \"XG_AssetPickerController.h\"`\n\n### 手动安装\n1. 下载 XGAssetPickerController 文件夹内的所有内容。\n2. 将 XGAssetPickerController 内的源文件添加(拖放)到你的工程。\n3. 由于用到了`FLAnimatedImage`，所以需要下载`FLAnimatedImage`（`https://github.com/Flipboard/FLAnimatedImage`），并添加(拖放)到你的工程。\n4.  `#import \"XG_AssetPickerController.h\"`.\n\n\n使用方法\n==============\n1. 先使用`[[XG_AssetPickerManager manager] handleAuthorizationWithCompletion:^(XG_AuthorizationStatus aStatus) {\n}];`检查是否获取相册权限，然后根据`XG_AuthorizationStatus`做进一步处理 \n\n2. 初始化`XG_AssetPickerOptions`对象来配置选择器，`maxAssetsCount`表示最大可选择数量，`videoPickable`表示是否可选择视频，已选的图片或者视频会保存在`pickedAssetModels`数组中。\n3. 使用初始化选择器`XG_AssetPickerController`，然后\n    `UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:photoPickerVc];`\n    `[self presentViewController:nav animated:YES completion:nil];`\n\n4. 遵循`\u003cXG_AssetPickerControllerDelegate\u003e`协议，并实现协议方法：\n`- (void)assetPickerController:(XG_AssetPickerController *)picker didFinishPickingAssets:(NSArray\u003cXG_AssetModel *\u003e *)assets;`，选择结果在参数`assets`中。\n\n    具体使用方法可参见示例Demo\n\n\n注意事项\n==============\n1. 如果运行崩溃,崩溃信息log为：`This app has crashed because it attempted to access privacy-sensitive data without a usage description.  The app's Info.plist must contain an NSPhotoLibraryUsageDescription/NSCameraUsageDescription key with a string value explaining to the user how the app uses this data`.\n请检查`Info.plist`是否添加相册/相机权限: `NSPhotoLibraryUsageDescription/NSCameraUsageDescription`\n\n2. 模拟器环境下，虽然在工程的`Localizations`配置中添加了简体中文`Chinese（Simplified）`,但相册名称仍会默认为英文，这是正常的，因为`Localizations`在真机环境下才会生效（即真机环境下相册名称会显示成中文）。\n\n\n许可证\n==============\n`XGAssetPickerController` 使用 MIT 许可证，详情见 LICENSE 文件。\n\n\u003cbr/\u003e\u003cbr/\u003e\n\n\n\nIntroduction\n==============\n`XGAssetPickerController` is an iOS album picker that supports mixed multi-image,multi-video selection and preview. Gif browsing is supproted on `iOS 11.0+`.   Same images or videos in different album can be automatically detected, and selected images or videos can be recorded.\n\nRequirements\n==============\nThis library requires `iOS 8.0+` .\n\nDemo Project\n==============\n1. Use the terminal to enter the path of `Demo`,then excute  `pod install`\n2. Click `XGAssetPickerController-Demo.xcworkspace`\n\nInstallation\n==============\n\n### CocoaPods\n\n1. Add `pod 'XGAssetPickerController'` to your Podfile.\n2. Run `pod install` or `pod update`.\n3. `#import \"XG_AssetPickerController.h\"`\n\n### Manually\n\n1. Download all the files in the XGAssetPickerController subdirectory.\n2. Add the source files to your Xcode project.\n3. This library references `FLAnimatedImage`, so you need to download `FLAnimatedImage` (`https://github.com/Flipboard/FLAnimatedImage`) and add its source files to your Xcode project too.\n4.  `#import \"XG_AssetPickerController.h\"`.\n\nUsage\n==============\n1. Check if you get an access to the photo library using `[[XG_AssetPickerManager manager] handleAuthorizationWithCompletion:^(XG_AuthorizationStatus aStatus) {\n}];`\n2. Initialize a `XG_AssetPickerOptions` object to config the `XG_AssetPickerController` \n3. Initialize a `XG_AssetPickerController` using `initWithOptions: delegate:` method,and present it using\n`UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:photoPickerVc];`\n`[self presentViewController:nav animated:YES completion:nil];`\n4. Adopt the `XG_AssetPickerControllerDelegate` protocol and implement it's required method `assetPickerController: didFinishPickingAssets:`\n\nNotice\n==============\nIf your app crashed with message like `This app has crashed because it attempted to access privacy-sensitive data without a usage description.  The app's Info.plist must contain an NSPhotoLibraryUsageDescription/NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.`, please check if the corresponding usage description is added in the app's Info.plist.\n\nLicense\n==============\n`XGAssetPickerController` is provided under the MIT license. See `LICENSE` file for details.\n\n\n\n\n\n\n \n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuxinguang%2Fxgimagepickercontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuxinguang%2Fxgimagepickercontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuxinguang%2Fxgimagepickercontroller/lists"}