• Stars
    star
    383
  • Rank 111,995 (Top 3 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

1D and 2D barcodes scanner and generators for iOS7 with delightful controls.

RSBarcodes Build Status

Total views Views in the last 24 hours

RSBarcodes allows you to scan 1D and 2D barcodes using metadata scanning capabilities introduced with iOS7 and generate the same set of barcode images for displaying and sharing. PR from MacMannes has been merged to make a part of code generators working on iOS5.1 above.

Current Status

###Barcode Scanner: Multiple corners and border rectangles display view -- Done Manually changing focus point -- Done Focus mark drawing -- Done

###Barcode Generators: "org.gs1.UPC-E", -- Done "org.iso.Code39", -- Done "org.iso.Code39Mod43", -- Done "org.gs1.EAN-13", -- Done by 张玺 (http://zhangxi.me) "org.gs1.EAN-8", -- Done by 张玺 (http://zhangxi.me) "com.intermec.Code93", -- Done "org.iso.Code128", -- Done "org.iso.PDF417", -- Done "org.iso.QRCode", -- Done "org.iso.Aztec", -- Done "org.ansi.Interleaved2of5", -- Done "org.gs1.ITF14", -- Done // -------------------- Extended Code 39, -- Done ISBN13, -- Done ISSN13, -- Done ITF14, -- Done

Code display view -- Done

Installation

CocoaPods is the recommended method of installing RSBarcodes.

Simply add the following line to your Podfile:

pod 'RSBarcodes', '~> 0.1.5'

Or you can use the RSBarcodes framework without import all headers files.

Just imports these frameworks:

RSBarcodes.framework (it's under the product folder of this project) :)
AVFoundation.framework
CoreImage.framework
CoreGraphics.framework

When you use the framework you must import the headers like below:

#import <RSBarcodes/aHeader.h>

RSCodeView.h and RSCodeGen.h are already imported into the RSBarcodes.h so you can use directly

#import <RSBarcodes/RSBarcodes.h>

Thanks to g8production www.g8production.com github for providing this.

Usage

###Barcode Scanner:

####Option 1:

Create RSScannerViewController from code an present it. Use the callback block to process the barcode.

(id)initWithCornerView:(BOOL)showCornerView controlView:(BOOL)showControlsView barcodesHandler:(RSBarcodesHandler)barcodesHandler;
(id)initWithCornerView:(BOOL)showCornerView controlView:(BOOL)showControlsView barcodesHandler:(RSBarcodesHandler)barcodesHandler preferredCameraPosition:(AVCaptureDevicePosition)cameraDevicePosition;

You can add borders to the button with: [scanner setIsButtonBordersVisible:YES]; You can automatically stop the processing after the first vaild barcode with [scanner setStopOnFirst:YES]; After that you can either dismiss it, or restart it with [scanner __startRunning];

possible Device Positions: AVCaptureDevicePositionBack, AVCaptureDevicePositionFront

RSScannerViewController *scanner = [[RSScannerViewController alloc] initWithCornerView:YES
                                                                       	   controlView:YES
                                                                   	       barcodesHandler:^(NSArray *barcodeObjects) {
                                                                       }
                                                               preferredCameraPosition:AVCaptureDevicePositionBack];

The ViewController can be presented modally: [self presentViewController:scanner animated:true completion:nil]; or pushed onto a NavigationController Stack: [self.navigationController pushViewController:scanner animated:YES]; ####Option 2:

Place a UIViewController in storyboard and set RSScannerViewController based class as its custom class. If you want to use the corners view (for barcode corners and borders displaying), you can put a UIView onto the view controller’s view and set RSCornersView as its custom class then link the highlightView to it, make sure the view’s size is as large as the view controller’s view.

In RSScannerViewController based class implements your own handler.

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        __weak typeof(self) weakSelf = self;
        self.barcodesHandler = ^(NSArray *barcodeObjects) {
        };
        self.tapGestureHandler = ^(CGPoint tapPoint) {
        });
    }
    return self;
}

###Barcode Generators:

Import RSCodeGen.h into your source file and using CodeGen to generate barcode image. RSBarcodes provides 2 ways.

@protocol RSCodeGenerator <NSObject>

- (UIImage *)genCodeWithMachineReadableCodeObject:(AVMetadataMachineReadableCodeObject *)machineReadableCodeObject;

- (UIImage *)genCodeWithContents:(NSString *)contents machineReadableCodeObjectType:(NSString *)type;

@end

Here are examples, the generated image could be used along with RSCodeView or UIImageView.

[CodeGen genCodeWithContents:<#(NSString *)#> machineReadableCodeObjectType:<#(NSString *)#>] // Types are coming from AVMetadataObject.h and RSCodeGen.h

or

[CodeGen genCodeWithMachineReadableCodeObject:<#(AVMetadataMachineReadableCodeObject *)#>]

License

The MIT License (MIT)

Copyright (c) 2012-2014 P.D.Q.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Bitdeli Badge

More Repositories

1

RSBarcodes_Swift

1D and 2D barcodes reader and generators for iOS 8 with delightful controls. Now Swift.
Swift
693
star
2

RSImageOptimPlugin

Xcode plugin to optimize images using ImageOptim.
Objective-C
216
star
3

RSYahooWeatherLoadingIndicator

This project clones the Yahoo weather app's loading indicator with no image at all, everything is drawing using Quartz and everything can be customised.
Objective-C
123
star
4

RSTransitionEffect

Re-implement mayuur's MJTransitionEffect(https://github.com/mayuur/MJTransitionEffect) and provide default data binding for UITableViewCell and detail view controller and solve the white screen problem. All images, data source are taken from mayuur's MJTransitionEffect.
Objective-C
101
star
5

RSGoogleNowStyleCardsView

This project clones the card inserting animation, card exchange animation and provides UITableView alike APIs for data sourcing and delegating.
Objective-C
100
star
6

RSCircaPageControl

Clones 'Circa' news detail view's page control and provide an easy to ready sample.
Objective-C
79
star
7

RSReadingBoard

ZAKER alike news/article reading board for iOS7.
Objective-C
78
star
8

CocoaControlsPlugin

OS X native application with Xcode plugin for browsing, searching, integrating, cloning controls in http://cocoacontrols.com/.
Objective-C
67
star
9

RSTMALLCell

Yet another clone, the target is Tmall this time. The latest update contains a cool feature, images on the right of the cell could be moved by finger if not releasing and when finger is releasing the image will go down and then invisible. This repo provides easy to use data object, cell, tableview controller and a sample for doing this.
Objective-C
49
star
10

RSCameraSwitchSample

A pure code implementation of http://dribbble.com/shots/929359-Camera-Switch with beautiful animations.
Objective-C
40
star
11

RSPOPPickerSheet

Fullscreen pop-able and block-able picker sheet.
Objective-C
20
star
12

WFH

能够远程办公(work from home)的公司名单
14
star
13

kustohelmize

Tired of creating Helm Charts from scratch? Try Kustohelmize today!
Go
13
star
14

iperf-iOS

Adapted iPerf3 iOS sample
C
12
star
15

RSPOPAlertView

Fullscreen pop-able and block-able alert view.
Objective-C
10
star
16

RSSQLiteEncryptSample

This Repo demonstrated HOW to encrypt a sqlite db using sqlcipher https://github.com/sqlcipher/sqlcipher
Objective-C
7
star
17

RSBmobWrapper

Bmob http://www.codenow.cn/ 是一个专门为移动应用程序开发提供所有必须的后端服务的产品(相当于Parse国内版)。从简单的数据存储到复杂的用户管理,数据分析,所有的功能都是为程序开发人员精心制作。无论多么复杂的后端,Bmob都提供了超级简单的原生软件开发工具包和API。来一起了解Bmob的特点和几行代码,您可在数分钟内开始运作你的移动应用。这个Repo提供了新的基类和Bmob相关内容的封装。
Objective-C
7
star
18

iOS-relative-view-layout-helper

UIView category: implements MS WPF style layout helper. Using margin (thickness), alignments to layout view inside its super view or beside one another view.
Objective-C
6
star
19

aihuishou

hpple demo展示如何获取爱回收的所有图标和机型
Objective-C
5
star
20

Lottery

简易年会抽奖程序 for iPad。
Objective-C
4
star
21

iphone-wireless

Automatically exported from code.google.com/p/iphone-wireless
Objective-C
4
star
22

kubemulti

A kubectl plugin to query multiple namespace at the same time.
Go
3
star
23

RSExpandableTableViewCell

Expandable tableview cell, working in progress.
Objective-C
2
star
24

RSImageFitness

UIImage category to get fitness image.
Objective-C
2
star
25

RSSafariAddressBar

iOS 7 Safari address bar alike control, working in progress.
Objective-C
2
star
26

minio

Go
1
star
27

RSBlingBling

Swift
1
star
28

Greent

Objective-C
1
star
29

yeahdongcn.github.io

HTML
1
star
30

ImVIP

Objective-C
1
star
31

k8s

A collection of scripts to boost k8s local development. Tested on m1 mbp.
Shell
1
star
32

slowhttptest

Automatically exported from code.google.com/p/slowhttptest
C++
1
star
33

TurtleRock

JavaScript
1
star
34

GCompare

Swift
1
star