{"id":26326230,"url":"https://github.com/kk-vv/himagepickerutils-swift","last_synced_at":"2025-10-19T21:50:05.897Z","repository":{"id":79747698,"uuid":"45227124","full_name":"kk-vv/HImagePickerUtils-Swift","owner":"kk-vv","description":"Swift4.0 - iOS 照片选取和拍照, 支持closure 回调","archived":false,"fork":false,"pushed_at":"2017-12-08T02:55:21.000Z","size":764,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T14:14:52.080Z","etag":null,"topics":["closure","imagepick","swift"],"latest_commit_sha":null,"homepage":"","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/kk-vv.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-30T03:32:54.000Z","updated_at":"2022-11-09T04:42:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"a547fa7e-4ca3-4aa8-afc3-4fd58119d099","html_url":"https://github.com/kk-vv/HImagePickerUtils-Swift","commit_stats":null,"previous_names":["kk-vv/himagepickerutils-swift"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kk-vv%2FHImagePickerUtils-Swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kk-vv%2FHImagePickerUtils-Swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kk-vv%2FHImagePickerUtils-Swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kk-vv%2FHImagePickerUtils-Swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kk-vv","download_url":"https://codeload.github.com/kk-vv/HImagePickerUtils-Swift/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kk-vv%2FHImagePickerUtils-Swift/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259280319,"owners_count":22833424,"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","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":["closure","imagepick","swift"],"created_at":"2025-03-15T19:35:58.354Z","updated_at":"2025-10-19T21:50:00.812Z","avatar_url":"https://github.com/kk-vv.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift-照片选取和拍照\n\n### Tips\n\n---\n\n- 支持照片选取和拍照\n- 支持Closure回调\n\n`注意Info.plist设置`\n\n```\nPrivacy - Camera Usage Description\nPrivacy - Photo Library Usage Description\n```\n\n### 使用方法  \n---\n\n- 定义为类的成员变量\n\n```\nlazy var imagePicker = HImagePickerUtils()\n//不能为临时变量，临时变量销毁时，UIImagePickerController代理方法不会回调\n```\n\n- 拍一张\n\n```\nimagePicker.takePhoto(presentFrom: self, completion: { [unowned self] (image, status) in\n    if status == .success {\n        self.image.image = image\n    }else{\n        if status == .denied{\n            HImagePickerUtils.showTips(at: self,type: .takePhoto)\n        }else{\n            print(status.description())\n        }\n    }\n})\n\n```\n- 从相册取\n\n```\nimagePicker.choosePhoto(presentFrom: self, completion: { [unowned self] (image, status) in\n    if status == .success {\n        self.image.image = image\n    }else{\n        if status == .denied{\n            HImagePickerUtils.showTips(at: self,type: .choosePhoto)\n        }else{\n            print(status.description())\n        }\n        \n    }\n})\n```\n\n\n### 效果图\n---\n\n\u003e\n![](https://github.com/iFallen/HImagePickerUtils-Swift/raw/master/ScreenShots/1.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkk-vv%2Fhimagepickerutils-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkk-vv%2Fhimagepickerutils-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkk-vv%2Fhimagepickerutils-swift/lists"}