Giter Club home page Giter Club logo

barcodereader's Introduction

BarcodeReader

iOS版本条形码扫描,同时支持普通二维码和条形码扫描。采用AVFoundation实现,支持iOS 7及以上版本。界面设计参照了QQ的二维码扫描,采用屏幕特定区域扫描。具体效果图如下: ScreenShot 当在屏幕绘制的矩形区域扫描到二维码后会通过声音提醒,同时返回到上一试图,并触发delegate函数。具体参照demo代码。 ##调用示例代码:

- (IBAction)scanBarcodeButtonClick:(id)sender
{
    UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"BarcodeStoryboard" bundle:nil];
    BarcodeReaderViewController *viewController = [storyBoard instantiateViewControllerWithIdentifier:@"BarcodeReaderViewController"];
    viewController.scanType = BarCode;
    viewController.delegate = self;
    [self presentViewController:viewController animated:YES completion:^{
        
    }];
}

#pragma mark - BarcodeReaderViewControllerDelegate
- (void)scanedBarcodeResult:(NSString *) barcodeResult
{
    self.barcodeString = barcodeResult;
}

##代码说明: 我采用独立的storyboard封装了二维码扫描试图,方便复用。同时在二维码扫描后,采用delegate scanedBarcodeResult:返回二维码数据。对于程序中的代码实现如果有兴趣了解的话,请参照如何使用AVFoundation框架扫描QR Code

联系 Support

授权 License

本项目采用 MIT license 开源,你可以利用采用该协议的代码做任何事情,只需要继续继承 MIT 协议即可。

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.