{"id":15037528,"url":"https://github.com/maryamfekri/mfcameramanager","last_synced_at":"2025-04-09T23:24:17.620Z","repository":{"id":62446749,"uuid":"80986098","full_name":"maryamfekri/MFCameraManager","owner":"maryamfekri","description":"MF Camera Manager","archived":false,"fork":false,"pushed_at":"2020-09-07T21:24:22.000Z","size":28838,"stargazers_count":42,"open_issues_count":1,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-22T10:16:15.234Z","etag":null,"topics":["barcode","barcode-scanner","camera","camera-manager","camera-preview","capture","crop","crop-image","ios","ios-app","scan","scanner","swift","swift3"],"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/maryamfekri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-05T10:37:57.000Z","updated_at":"2024-07-06T22:40:46.000Z","dependencies_parsed_at":"2022-11-01T23:06:13.654Z","dependency_job_id":null,"html_url":"https://github.com/maryamfekri/MFCameraManager","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maryamfekri%2FMFCameraManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maryamfekri%2FMFCameraManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maryamfekri%2FMFCameraManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maryamfekri%2FMFCameraManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maryamfekri","download_url":"https://codeload.github.com/maryamfekri/MFCameraManager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248127150,"owners_count":21052195,"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":["barcode","barcode-scanner","camera","camera-manager","camera-preview","capture","crop","crop-image","ios","ios-app","scan","scanner","swift","swift3"],"created_at":"2024-09-24T20:34:55.497Z","updated_at":"2025-04-09T23:24:17.577Z","avatar_url":"https://github.com/maryamfekri.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CameraManager Features :\n\n● manage camera session \n\n● get image from camera \n\n● crop image in a frame\n\n● scan barcode and get the image asynchronously  \n\n\n# Requirements :\n\niOS 8.0+\n\nXcode 8.1+\n\nSwift 3.0+ (Support Swift 4) \n\n---------------------------------------------------------------------------\n**Demo :** \n\n![www gifcreator me_3krqfy](https://cloud.githubusercontent.com/assets/13133764/22628149/36ce4070-ebe4-11e6-9fd9-fdd3fb2ce42f.gif)\n\n---------------------------------------------------------------------------\n\n# Installation :\n\n**CocoaPods :**\n\n\n```\npod 'MFCameraManager'\n\n```\n\n**or download CustomCameraManagerClass directory and add it manually to your project**  \n\n# Setup :\n\nNow in your view add a UIView to storyboard view controller or programmetically initiate an UIView which will be your camera preview. then follow steps to display the camera : \n\n**If you just need the camera session and capturing image you have to use CameraManager.swift class, as it has StillImageOutput.** \n\n**but if you need the camera session to scan barcode beside capturing image you have to use ScanBarcodeCameraManager.swift class, as it has StillImageOutput.** \n\n**initial step**\n---------------------------------------------------------------------------\n\nCreate a variable of which class you prefer (ScanBarcodeCameraManager.swift or CameraManager.swift) :\n\n`  var cameraManager = CameraManager() `\n\nor \n\n`  var cameraManager = ScanBarcodeCameraManager() `\n\n\nfrom now on below 4 steps are similar in each class you instantiated :\n\n1 - on your viewDidLoad setup the camera with your UIView created to show the camera preview inside it, and your camera position which its default is back :\n\n`  cameraManager.captureSetup(in: self.cameraView, with: .back) `\n\n\n2 - in viewWillApear delegate call this method : \n\n`   cameraManager.startRunning() `\n\n3 - in viewDidDisapear delegate call below method :\n\n` cameraManager.stopRunning() `\n\n4 - to support landscape transitions add below code to viewWillTransition Delegate : \n\n` cameraManager.transitionCamera() `\n\n\n**Features in CameraManager class**\n----------------------------\n\n- to capture an image showing on camera  : \n\n```\nself.cameraManager.getcroppedImage { (UIImage, error) in\n\n          //your code here to handle with error or if error == nil , get the UIImage \n}\n```\n\n- to get the image inside a frame or CGRect , give the frame as a params to getcroppedImage function like below : \n\n```\nself.cameraManager.getcroppedImage(with: self.rectLayer.frame) {  (UIImage, error) in\n         \n       //your code here to handle with error or if error == nil , get the UIImage \n           \n }\n\n```\n\n**Features in ScanBarcodeCameraManager class**\n----------------------------\n\n- to get the scanned barcode and capture an image : \n\nshould conform to protocol ScanBarcodeCameraManagerDelegate and : \n\n```\nself.cameraManager.delegate = self\n\n```\n\nthen implement the function to get the barcode objects and also the captured image :\n\n```\nfunc scanBarcodeCameraManagerDidRecognizeBarcode(barcode: Array\u003cAVMetadataMachineReadableCodeObject\u003e, image: UIImage?) {\n        self.scanBarcodeCameraManager.stopRunning()\n        print(barcode)\n        // to whatever you like to the barcode objects and the image\n        scanBarcodeCameraManager.startRunning()\n\n    }\n```\n\n**Extra features in all classess**\n----------------------------\n- to enable torch mode use below code with level of torch mode default is 1 : \n\n`cameraManager.enableTorchMode(level: 1)`\n\n\n\n\n# Communication :\n\n- If you found a bug, open an issue.\n- If you have a feature request, open an issue.\n- If you want to contribute, submit a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaryamfekri%2Fmfcameramanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaryamfekri%2Fmfcameramanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaryamfekri%2Fmfcameramanager/lists"}