narlei / regexscanner

RegexScanner is a Camera scanner to read values that match with a regex.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RegexScanner

Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 13 or newer
  • Swift 5

Installation

RegexScanner is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'RegexScanner'

To Use:

import RegexScanner 

And simple call

let scannerView = RegexScanner.getScanner(regex: "[A-Z]{2}[0-9]{9}[A-Z]{2}") { value in
    print(value)
}
present(scannerView, animated: true, completion: nil)

When the text is recognized, the view closes and the value is send to closure.

Do not forget add NSCameraUsageDescription to your Info.plist

You can custom the texts using the scannerView.:

  • buttonConfirmTitle
  • buttonConfirmBackgroundColor
  • viewTitle

Author

Narlei Moreira, narlei.guitar@gmail.com

If do you like, give your ⭐️

License

RegexScanner is available under the MIT license. See the LICENSE file for more info.

Pay me a coffee:

paypal

About

RegexScanner is a Camera scanner to read values that match with a regex.

License:MIT License


Languages

Language:Swift 89.6%Language:Ruby 10.4%