Skip to content

Commit

Permalink
first beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ochs committed Sep 22, 2013
1 parent 34f972c commit ae445da
Show file tree
Hide file tree
Showing 26 changed files with 1,878 additions and 3 deletions.
649 changes: 649 additions & 0 deletions BCScanner.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions BCScanner/BCScanner-Prefix.pch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#endif
124 changes: 124 additions & 0 deletions BCScanner/BCScannerViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
//
// BCScannerViewController.h
// BCScannerViewController
//
// Copyright 2013 bitecode, Michael Ochs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import <UIKit/UIKit.h>


extern NSString *const BCScannerQRCode; /// The code type used for QR codes.
extern NSString *const BCScannerUPCECode;

//extern NSString *const BCScannerCode39Code;
//extern NSString *const BCScannerCode39Mod43Code;

extern NSString *const BCScannerEAN13Code;
extern NSString *const BCScannerEAN8Code;

//extern NSString *const BCScannerCode93Code;
//extern NSString *const BCScannerCode128Code;
//extern NSString *const BCScannerPDF417Code;
//extern NSString *const BCScannerAztecCode;




@protocol BCScannerViewControllerDelegate;


/**
* BCScannerViewController is a view controller that wrapps the scanning capabilities
* of iOS7 into a simple to use drop-in view controller for easy integration into your app.
*
* It is build for the purpose of scanning a single or multiple codes in a deticated screen
* and encapsules all the camera handling and metadata gathering.
*
* The view controller can be presented or pushed onto a navigation stack. It is up to you
* to present and dismiss the view controller whenever you need it.
*/
@interface BCScannerViewController : UIViewController

/**
* This method lets you check for the availability of the native scanner functionality
* provided by AVFoundation.
*
* @note Do not instanciate this class if this method returns NO!
*
* @return YES if native scanning is available, NO otherwise.
*/
+ (BOOL)scannerAvailable;

/**
* This is the delegate of the scanner. The delegate will get called to notify you about
* codes that were found in the field of view of the camera.
*/
@property (nonatomic, weak, readwrite) id<BCScannerViewControllerDelegate> delegate;

/**
* This is an array of the codes the scanner should look for. The more code types you
* specify, the longer the image analysis will take!
*
* @see BCScannerCode constants
*/
@property (nonatomic, strong, readwrite) NSArray *codeTypes;

/**
* This is the gesture recognizer that is used to let the user focus and expose to a
* specific point in the field of view. You can access this property when you want to
* more precisely control what taps should be recognized.
*/
@property (nonatomic, weak, readonly) UITapGestureRecognizer *focusAndExposeGestureRecognizer;

@end


@protocol BCScannerViewControllerDelegate <NSObject>

@optional
/**
* This method is called whenever a new code enters the field of view.
*
* @param scanner The scanner that is calling this delegate
* @param codes A list of all the codes that entered the FOV in this interval
*
* @note If you do a simple scan for the first code you find, you can get the code
* from this method and close the scanner afterwards.
*/
- (void)scanner:(BCScannerViewController *)scanner codesDidEnterFOV:(NSSet *)codes;

//- (void)scanner:(BCScannerViewController *)scanner codesDidUpdate:(NSSet *)codes;

/**
* This method is called whenever an existing code leaves the field of view.
*
* @param scanner The scanner that is calling this delegate
* @param codes A list of all the codes that left the FOV in this interval
*/
- (void)scanner:(BCScannerViewController *)scanner codesDidLeaveFOV:(NSSet *)codes;

/**
* This method lets you specify an image that is shown as an overlay to give the user
* some feedback about how to hold the camera.
*
* This method is called when the scanner configures its interface.
*
* @param scanner The scanner that is calling this delegate
* @return The image you want to be used as HUD
*/
- (UIImage *)scannerHUDImage:(BCScannerViewController *)scanner;

@end
Loading

0 comments on commit ae445da

Please sign in to comment.