GithubHelp home page GithubHelp logo

pixel16 / tkscankit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xslim/tkscankit

0.0 2.0 0.0 40 KB

Use multiple scanning SDKs with one clean API

License: MIT License

Objective-C 82.73% Ruby 17.27%

tkscankit's Introduction

TKScanKit

TKScanKit is a Cocoapods only library, inspired by ARAnalytics, which provides a clean API for different scanning SDKs. It does this by using subspecs from CocoaPods to let you decide which libraries you'd like to use.

Usage

To get list of loaded providers:

NSArray *items = [TKScanKit availableProviders];

To start scanning:

TKScanningProvider *provider = [TKScanKit newProviderWithName:@"ZBarSDK"];
provider.delegate = self;
[provider presentScannerFromViewController:viewController];
self.scanningProvider = provider;

Or

self.currentProvider = [TKScanKit presentScanner:@"ZBarSDK" fromViewController:self];

And became a delegate of TKScanningProviderDelegate:

- (void)scanningProvider:(TKScanningProvider *)provider didFinishScanningWithText:(NSString *)text info:(NSDictionary *)info
{
    NSString *title = [NSString stringWithFormat:@"Scanned: %@", text];
    [self showMessageWithTitle:title text:[info description]];
}

- (void)scanningProviderDidCancel:(TKScanningProvider *)provider { }

- (void)scanningProvider:(TKScanningProvider *)provider didFailedScanningWithError:(NSError *)error
{
    [self showMessageWithTitle:@"Error" text:[error localizedDescription]];
}

To run the example project:

  • clone the repo
  • run pod install from the TKScanKitApp directory
  • Try it

Supported scanning providers

Feel free to add more!

Installation

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

pod "TKScanKit"

Author

Taras Kalapun, [email protected]

License

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

tkscankit's People

Contributors

xslim avatar pixel16 avatar angelolloqui avatar

Watchers

James Cloos avatar  avatar

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.