{"id":30672972,"url":"https://github.com/janlionly/avatarimagepicker","last_synced_at":"2025-09-01T05:40:20.334Z","repository":{"id":56902618,"uuid":"203108248","full_name":"janlionly/AvatarImagePicker","owner":"janlionly","description":"A single line of code for selecting the optional editing image from Camera or Photo Library, including handling the authorizations of Photo library and Camera.","archived":false,"fork":false,"pushed_at":"2020-11-06T10:24:51.000Z","size":17883,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-11T04:47:48.096Z","etag":null,"topics":["authorization","avatar","camera","imagepicker","imagepickercontroller","photo-library"],"latest_commit_sha":null,"homepage":"https://github.com/janlionly/AvatarImagePicker","language":"Swift","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/janlionly.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":"2019-08-19T06:03:18.000Z","updated_at":"2024-01-08T15:29:55.000Z","dependencies_parsed_at":"2022-08-21T01:50:43.627Z","dependency_job_id":null,"html_url":"https://github.com/janlionly/AvatarImagePicker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/janlionly/AvatarImagePicker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlionly%2FAvatarImagePicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlionly%2FAvatarImagePicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlionly%2FAvatarImagePicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlionly%2FAvatarImagePicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janlionly","download_url":"https://codeload.github.com/janlionly/AvatarImagePicker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlionly%2FAvatarImagePicker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273077227,"owners_count":25041358,"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-01T02:00:09.058Z","response_time":120,"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":["authorization","avatar","camera","imagepicker","imagepickercontroller","photo-library"],"created_at":"2025-09-01T05:40:11.917Z","updated_at":"2025-09-01T05:40:20.307Z","avatar_url":"https://github.com/janlionly.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AvatarImagePicker \u0026 AuthSettings\n\u003cimg src=\"https://media.giphy.com/media/d8cCPuT1hjkNNb2dnT/giphy.gif\" width=\"250\" height=\"541\"\u003e\t\u0026\t\u003cimg src=\"https://github.com/janlionly/AvatarImagePicker/blob/master/Resources/AuthSettings.png\" width=\"250\" height=\"541\"\u003e\n\n[![Version](https://img.shields.io/cocoapods/v/AvatarImagePicker.svg?style=flat)](https://cocoapods.org/pods/AvatarImagePicker)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![License](https://img.shields.io/cocoapods/l/AvatarImagePicker.svg?style=flat)](https://github.com/janlionly/AvatarImagePicker/blob/master/LICENSE)\n[![Platform](https://img.shields.io/cocoapods/p/AvatarImagePicker.svg?style=flat)](https://github.com/janlionly/AvatarImagePicker)\n![Swift](https://img.shields.io/badge/%20in-swift%204.2-orange.svg)\n\n## Description\n**AvatarImagePicker** is a photo library and camera Image Picker for iOS  \nwritten in Swift, it's just a single line of code, support for selecting user's avatar by Camera or Photo Library, editing the selected image. Also, it supports auth verification, if camera or photo library was denied, it will alert the user to the settings for opening it. it means to replace for UIImagePickerController. Compatible with both Swift and Objective-C.\n\n## Installation\n\n### CocoaPods\n```ruby\npod 'AvatarImagePicker'\n```\n\n### Carthage\n```ruby\ngithub \"janlionly/AvatarImagePicker\"\n```\n\n### Swift Package Manager\n- iOS: Open Xcode, File-\u003eSwift Packages, search input **https://github.com/janlionly/AvatarImagePicker.git**, and then select Version Up to Next Major **1.3.0** \u003c .\n- Or add dependencies in your `Package.swift`:\n```swift\n.package(url: \"https://github.com/janlionly/AvatarImagePicker.git\", .upToNextMajor(from: \"1.3.0\")),\n```\n\n## Usage\n\n**AvatarImagePicker** is presented with an actionsheet for camera and photo library, and then presented an ImagePickerController, optional some properties supports to customize, like **sourceTypes**, **presentStyle** and **dismissAnimated**.\u003cbr\u003e\n\nRemember to add **NSCameraUsageDescription** and **NSPhotoLibraryUsageDescription**'s keys for descriptions to your Info.plist\n\n### Swift\n\n```swift\nlet picker = AvatarImagePicker.instance\n\n// optional: custom properties\npicker.dismissAnimated = false // default is true\npicker.sourceTypes = [.camera] // default is [.camera, .photoLibrary]\npicker.presentStyle = .overFullScreen // default is .fullScreen\n\n// this method includes authorizing for photolibrary and camera.\npicker.present(allowsEditing: true, selected: { (image) in\n\t// selected image\n}) {\n\t// tapped cancel\n   } \n\n\n// v1.3.2 updated: support to customize actions for sheet\npicker.sourceTypes = [.camera, .customAction]\nweak var weakSelf = self\npicker.customActions = [\"Delete\": { weakSelf?.imageView.image = nil }]\n\n\n// or you can call only auth photolibrary and camera, it will alert the user to go to settings if the photolibrary or camera was denied.\nlet isAuthSuccess = AuthSettings.authPhotoLibrary(message: \"auth photolibrary to get your avatar\") {\n  print(\"auth success\")\n  // go to present image picker controller(photo library), customize your operation here.\n}\n_ = AuthSettings.authCamera(message: \"auth camera to get your avatar\") {\n  print(\"auth success\")\n  // go to present image picker controller(camera), customize your operation here.\n}\n```\n\n### Objective-C\n\n```objc\n[[AvatarImagePicker avatarImagePicker] presentWithAllowsEditing:YES selected:^(UIImage * _Nonnull image) {\n        // selected image\n    } cancel:^{\n        // tapped cancel\n    }];\n```\n\n## Requirements\n\n- iOS 9.0+\n- Swift 4.2 to 5.2\n\n## Author\n\nVisit my github: [janlionly](https://github.com/janlionly)\u003cbr\u003e\nContact with me by email: janlionly@gmail.com\n\n## Contribute\n\nI would love you to contribute to **AvatarImagePicker**\n\n## License\n\n**AvatarImagePicker** is available under the MIT license. See the [LICENSE](https://github.com/janlionly/AvatarImagePicker/blob/master/LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanlionly%2Favatarimagepicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanlionly%2Favatarimagepicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanlionly%2Favatarimagepicker/lists"}