TKScanKit 0.1.2

TKScanKit 0.1.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Taras Kalapun.



TKScanKit 0.1.2

  • By
  • Taras Kalapun

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

Author

Taras Kalapun, [email protected]

License

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