{"id":1215,"url":"https://github.com/zhangao0086/DKCamera","last_synced_at":"2025-07-30T20:32:45.355Z","repository":{"id":56907527,"uuid":"41629085","full_name":"zhangao0086/DKCamera","owner":"zhangao0086","description":"A light weight \u0026 simple \u0026 easy camera for iOS by Swift.","archived":false,"fork":false,"pushed_at":"2022-09-15T07:20:17.000Z","size":283,"stargazers_count":88,"open_issues_count":8,"forks_count":45,"subscribers_count":8,"default_branch":"develop","last_synced_at":"2024-11-25T22:42:10.093Z","etag":null,"topics":[],"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/zhangao0086.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":"2015-08-30T13:11:09.000Z","updated_at":"2023-08-02T10:00:09.000Z","dependencies_parsed_at":"2022-08-21T03:20:54.976Z","dependency_job_id":null,"html_url":"https://github.com/zhangao0086/DKCamera","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangao0086%2FDKCamera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangao0086%2FDKCamera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangao0086%2FDKCamera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangao0086%2FDKCamera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhangao0086","download_url":"https://codeload.github.com/zhangao0086/DKCamera/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228187574,"owners_count":17882328,"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":[],"created_at":"2024-01-05T20:15:41.452Z","updated_at":"2024-12-04T20:31:06.214Z","avatar_url":"https://github.com/zhangao0086.png","language":"Swift","funding_links":[],"categories":["Hardware"],"sub_categories":["Camera","Other free courses"],"readme":"DKCamera\n=======================\n\n [![Build Status](https://secure.travis-ci.org/zhangao0086/DKCamera.svg)](http://travis-ci.org/zhangao0086/DKCamera) [![Version Status](http://img.shields.io/cocoapods/v/DKCamera.png)][docsLink] [![license MIT](https://img.shields.io/cocoapods/l/DKCamera.svg?style=flat)][mitLink] [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n\n\u003cimg width=\"50%\" height=\"50%\" src=\"https://raw.githubusercontent.com/zhangao0086/DKCamera/develop/Screenshot1.png\" /\u003e\n\n---\n## Description\nA light weight \u0026 simple \u0026 easy camera for iOS by Swift. It uses `CoreMotion` framework to detect device orientation, so the screen-orientation lock will be ignored(*Perfect orientation handling*). And it has two other purposes:\n\n* Can be presenting or pushing or Integrating.\n* Suppressing the warning **\"Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.\"**(It seems a bug in iOS 8).\n* Compatible with iOS 11 and iPhone X\n\n## Requirements\n* Xcode 9\n* Swift 3.2 \u0026 4.2\n\n## Installation\n#### Swift Package Manager\n\n***In progress***\n\n\u003e  SPM only support source code, which means it cannot include resources such as images.\n\n#### iOS 8 and newer\n\nDKCamera is available on CocoaPods. Simply add the following line to your podfile:\n\n```ruby\n# For latest release in cocoapods\npod 'DKCamera'\n```\n\n#### iOS 7.x\n\u003e Please use the `1.2.11` tag.\n\u003e To use Swift libraries on apps that support iOS 7, you must manually copy the files into your application project.\n\u003e [CocoaPods only supports Swift on OS X 10.9 and newer, and iOS 8 and newer.](https://github.com/CocoaPods/blog.cocoapods.org/commit/6933ae5ccfc1e0b39dd23f4ec67d7a083975836d)\n\n## Easy to use\n\n```swift\nlet camera = DKCamera()\n\ncamera.didCancel = {\n\tprint(\"didCancel\")\n\n\tself.dismiss(animated: true, completion: nil)\n}\n\ncamera.didFinishCapturingImage = { (image: UIImage?, metadata: [AnyHashable : Any]?) in\n    print(\"didFinishCapturingImage\")\n    \n    self.dismiss(animated: true, completion: nil)\n    \n    self.imageView?.image = image\n}\n\nself.present(camera, animated: true, completion: nil)\n\n````\n\n### You also can use these APIs:\n\n```swift\nopen var cameraOverlayView: UIView?\n\n/// The flashModel will to be remembered to next use.\nopen var flashMode:AVCaptureFlashMode!\n\nopen class func isAvailable() -\u003e Bool\n\n/// Determines whether or not the rotation is enabled.\nopen var allowsRotate = false\n\n/// set to NO to hide all standard camera UI. default is YES.\nopen var showsCameraControls = true\n\nopen var defaultCaptureDevice = DKCameraDeviceSourceType.rear\n\n/// Photos will be tagged with the location where they are taken.\n/// Must add the \"Privacy - Location XXX\" tag to your Info.plist.\nopen var containsGPSInMetadata = false\n\n/// Notify the listener of the detected faces in the preview frame.\nopen var onFaceDetection: ((_ faces: [AVMetadataFaceObject]) -\u003e Void)?\n```\n\n\u003e If you are going to add a full-screen view as `cameraOverlayView`, maybe you should use the `DKCameraPassthroughView` or its subclass that have overriden the `hitTest` method in order to the event passes through to the expected view.\n```swift\n//  DKCamera.swift\npublic class DKCameraPassthroughView: UIView {\n\tpublic override func hitTest(point: CGPoint, withEvent event: UIEvent?) -\u003e UIView? {\n\t\tlet hitTestingView = super.hitTest(point, withEvent: event)\n\t\treturn hitTestingView == self ? nil : hitTestingView\n\t}\n}\n```\n\n## License\nDKCamera is released under the MIT license. See LICENSE for details.\n\n[docsLink]:http://cocoadocs.org/docsets/DKCamera\n[mitLink]:http://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhangao0086%2FDKCamera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhangao0086%2FDKCamera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhangao0086%2FDKCamera/lists"}