TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained 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.
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:
pod install
from the TKScanKitApp
directoryFeel free to add more!
Taras Kalapun, [email protected]
TKScanKit is available under the MIT license. See the LICENSE file for more info.