Giter Site home page Giter Site logo

swiftbarcodereader's Introduction

SwiftBarcodeReader

This is a helper library for capturing barcode or QR written in Swift.

Usage

On calling presentBarcodeReader, capturing View Controller will be modaled.

You can specifiy AVMetadataObjectTypes as enum, requirement of change camera position button and handling result/error using closure.

import SwiftBarcodeReader

func appear(){
        presentBarcodeReader(scanTypes: [.EAN13Code], //you can specify code type to scan type as enum value
                             needChangePositionButton: true, // If you need change position button, pass `true`
                             success: { (type, value) in
            print("type:\(type) value:\(value)")
            self.resultLabel.text = "\(value)"

        }) {(canceled, error) in
            
            //cancel handle when tapped back button
            if canceled {
                print("canceled")
            }
            
            //error handle when occured some error
            if error != nil {
                print("error:\(error)")
            }
        }
    }

Requirements

  • Xcode 8 and Swift 3.0
  • iOS 8.0 and later

Installation

Cocoapod

pod "SwiftBarcodeReader"

Carthage

Prepare Cartfile, then add below.

github "d-date/SwiftBarcodeReader"

Run below on Terminal.

carthage update --platform-iOS

Author

Daiki Matsudate(@d_date)

Contribute

If you want to add new feature or fix bug, make an issue first and try to contact me.

License

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

TODO

  • Custermizable Capturing UI
  • Show Capturing Rect

swiftbarcodereader's People

Contributors

d-date avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

thepowerofswift

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.