{"id":18951307,"url":"https://github.com/adorsys/yeswescan","last_synced_at":"2025-08-22T00:32:00.600Z","repository":{"id":33178427,"uuid":"131003630","full_name":"adorsys/YesWeScan","owner":"adorsys","description":"A library with a ready to use view controller for document scanning","archived":false,"fork":false,"pushed_at":"2022-10-06T02:54:13.000Z","size":3594,"stargazers_count":98,"open_issues_count":10,"forks_count":31,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-14T12:53:56.276Z","etag":null,"topics":["document","ios","library","scanner"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adorsys.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-04-25T12:34:20.000Z","updated_at":"2024-04-14T12:53:56.276Z","dependencies_parsed_at":"2022-07-29T18:49:58.655Z","dependency_job_id":null,"html_url":"https://github.com/adorsys/YesWeScan","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adorsys%2FYesWeScan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adorsys%2FYesWeScan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adorsys%2FYesWeScan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adorsys%2FYesWeScan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adorsys","download_url":"https://codeload.github.com/adorsys/YesWeScan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230542288,"owners_count":18242332,"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":["document","ios","library","scanner"],"created_at":"2024-11-08T13:27:29.173Z","updated_at":"2024-12-20T06:07:03.545Z","avatar_url":"https://github.com/adorsys.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/adorsys/YesWeScan/master/Images/banner.jpg\" width=\"1700\" max-width=\"100%\" alt=\"YesWeScan\" /\u003e\n\u003c/p\u003e\n\n[![Build Status](https://github.com/adorsys/YesWeScan/workflows/CI/badge.svg)](https://github.com/adorsys/YesWeScan/actions)\n[![Swift 5.2](https://img.shields.io/badge/swift-5.2-ED523F.svg?style=flat)](https://swift.org/download/)\n[![license](https://img.shields.io/badge/license-Apache_2.0-lightgrey.svg)](https://github.com/adorsys/YesWeScan/blob/master/LICENSE)\n[![platform](https://img.shields.io/badge/platform-iOS_10+-lightgrey.svg)](https://img.shields.io/badge/platform-iOS_10+-lightgrey.svg)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![SPM compatible](https://img.shields.io/badge/SPM-compatible-4BC51D.svg?style=flat)](https://swift.org/package-manager/)\n\nThis pod contains a ready to use view controller for document scanning. Yes we scan!\n\n- [Requirements](#requirements)\n- [Scanner Preview](#scanner-preview)\n- [Installation](#installation)\n  - [CocoaPods](#cocoapods)\n  - [Carthage](#carthage)\n  - [Swift Package Manager](#swift-package-manager)\n- [Usage](#usage)\n  - [Scanner View Controller](#scanner-view-controller)\n  - [Delegate Methods](#delegate-methods)\n  - [Scanner Quality](#scanner-quality)\n  - [Image Features needed before automatically capture](#image-features-needed-before-automatically-capture)\n  - [UI Configuration](#ui-configuration)\n  - [Performance hint](#performance-hint)\n  - [Siri Shortcuts](#siri-shortcuts)\n  - [Using the scanner directly](#using-the-scanner-directly)\n- [License](#license)\n\n## iOS 13 notice\n\niOS 13 contains the [`VNDocumentCameraViewController`][ios-scanner], which is an\nApple-provided class that is likely to achieve better results and have less bugs\nthan this pod.\n\nIf your app is targeting iOS 13 or higher, please consider using it instead of\nthis pod.\n\n[ios-scanner]: https://developer.apple.com/documentation/visionkit/vndocumentcameraviewcontroller\n\n## Requirements\n\n- iOS 10.0 SDK or later\n\n| Xcode Version | YesWeScan |\n|---------------|-----------|\n| \u003c= 10.1       | \u003c= 1.3.0  |\n| \u003e= 10.2       | =\u003e 2.0.0  |\n\n## Scanner Preview\n\n\u003cimg src=\"https://raw.githubusercontent.com/adorsys/YesWeScan/master/Images/preview.GIF\" width=\"250\" max-width=\"50%\" alt=\"Demo\" /\u003e\n\n## Installation\n\n### CocoaPods\n\nYesWeScan is available through [CocoaPods](http://cocoapods.org).\nTo install it, simply add the following line to your `Podfile`:\n\n```ruby\npod 'YesWeScan', ~\u003e '2.0'\n```\n\n### Carthage\n\nYesWeScan is also available via [Carthage](https://github.com/Carthage/Carthage).\nAdd the following line to your `Cartfile`:\n\n```\ngithub \"adorsys/YesWeScan\"\n```\n\n### Swift Package Manager\n\nStarting in version 2.2.0,\n[Swift Package Manager](https://swift.org/package-manager/) is also supported 🎉\n\nAdd it to your project like this:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/adorsys/YesWeScan.git\", from: \"2.2.0\")\n]\n```\n\n## Usage\n\nThe scanner needs access to the camera.\nIn order to allow this, your `Info.plist` must contain the `NSCameraUsageDescription` key.\n\n![An info.plist entry for NSCameraUsageDescription](https://raw.githubusercontent.com/adorsys/YesWeScan/master/Images/CameraUsagePlist.png)\n\n### Scanner View Controller\n\nThe main class in this project is `ScannerViewController`. You can access it\nwith `import YesWeScan`.\n\n```swift\nimport YesWeScan\n\nclass ViewController: UIViewController {\n  var scannedImage: UIImage?\n\n  override func viewDidLoad() {\n    super.viewDidLoad()\n\n    let scanner = ScannerViewController()\n    scanner.delegate = self\n    navigationController?.pushViewController(scanner, animated: true)\n  }\n}\n```\n\n### Delegate Methods\n\nThe scanner will __not__ capture images without a delegate.\nYou should therefore set the `delegate` property of the `ScannerViewController`.\n\nYou will then receive calls when the scanner found an image of suitable quality:\n\n```swift\nextension ViewController: ScannerViewControllerDelegate {\n  func scanner(_ scanner: ScannerViewController, didCaptureImage image: UIImage) {\n    scannedImage = image\n    navigationController?.popViewController(animated: true)\n  }\n}\n```\n\n### Scanner Quality\n\nYou can customize the scanner's accuracy using the `jitter` property. Higher\nvalues will make it easier to capture an image, but it won't be as steady.\n\nThe default value here is `100`.\n\nThe Scanner resolution can be configured by passing the `ScannerViewController`\nan `AVCaptureSession.Preset` during initialization. The default value is\n`.high`. If the given preset isn't supported by the capture device, it'll fall\nback to the default value.\n\n### Image Features needed before automatically capture\n\nYou can change the variable `scanningQuality` to control the scanning quality\nof the image. Changes to `scanningQuality` will influence the number of\nfeatures required before taking a capture.\n\n```swift\nenum Quality {\n  case high, medium, fast\n}\n```\n\nThe default value is `.medium` and this variable is available\nin `ScannerViewController`.\n\n```swift\nscanner.scanningQuality = .fast\n```\n\n### UI Configuration\n\nThe scanner's UI can be configured using the initializer:\n\n```swift\nScannerViewController(config: [.torch, .manualCapture])\n```\n\nThe following options are available:\n\n+ `.targetBraces`: A button to toggle targeting braces\n+ `.torch`: A button for controlling the torch\n+ `.manualCapture`: A manual camera shutter\n+ `.progressBar`: Show a progress bar for the current scan\n\nThe default value here is `.all`.\n\nYou can also configure the `previewColor` (color of scan preview rect) and\n`braceColor` (color of the target finder braces).\n\nThe defaults here are `UIColor.green` and `UIColor.red`, respectively.\n\n### Siri Shortcuts\n\nThe scanner example project supports Siri Shortcuts since iOS 12*.\nThe User own shortcut opens the app and navigates to the Document Scanner.\nYou can find the implementation in the example project.\n\nThe implementation works as follows:\nActivate Siri in the project and add a `NSUserActivityTypes` identifier in `info.plist`.\nThen activate Siri Shortcut adding following lines in the project:\n\n```swift\nif #available(iOS 12.0, *) {\n  let identifier = Bundle.main.userActivityIdentifier\n  let activity = NSUserActivity(activityType: identifier)\n  activity.title = \"The String the User will see in preferences\"\n  activity.userInfo = [\"Document Scanner\": \"open document scanner\"]\n  activity.isEligibleForSearch = true\n  activity.isEligibleForPrediction = true\n  activity.persistentIdentifier = NSUserActivityPersistentIdentifier(identifier)\n  view.userActivity = activity\n  activity.becomeCurrent()\n}\n```\n\nTo call a specific function, like `openDocumentScanner()`, add this to `AppDelegate`:\n\n```swift\nfunc application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -\u003e Void) -\u003e Bool {\n  if #available(iOS 12.0, *) {\n    guard userActivity.activityType == Bundle.main.userActivityIdentifier,\n      let navigationController = window?.rootViewController as? UINavigationController,\n      let viewController = navigationController.children.first as? ViewController else {\n        return false\n    }\n    viewController.openDocumentScanner()\n    return true\n  } else {\n    return false\n  }\n}\n```\n\n### Using the scanner directly\n\nIt's also possible to use the scanner class without the `ScannerViewController`\nclass (that is part of this pod) directly.\n\nAs an example how to do this, take a look at the [`CustomUIViewController`][custom VC] class.\n\n[custom VC]: https://github.com/adorsys/YesWeScan/blob/master/Example/YesWeScanExampleApp/CustomUIViewController.swift\n\n## License\n\nYesWeScan is released under the **Apache 2.0 License**. Please see the [LICENSE](https://github.com/adorsys/YesWeScan/blob/master/LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadorsys%2Fyeswescan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadorsys%2Fyeswescan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadorsys%2Fyeswescan/lists"}