Commit 4d4efd12 authored by Eloy Duran's avatar Eloy Duran

Import the EmbedReader example from ZBarSDK: http://zbar.sourceforge.net

parent c068650a
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DCFB448E136F7202004B3EE0"
BuildableName = "EmbedReader.app"
BlueprintName = "EmbedReader"
ReferencedContainer = "container:EmbedReader.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
displayScaleIsEnabled = "NO"
displayScale = "1.00"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DCFB448E136F7202004B3EE0"
BuildableName = "EmbedReader.app"
BlueprintName = "EmbedReader"
ReferencedContainer = "container:EmbedReader.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
displayScaleIsEnabled = "NO"
displayScale = "1.00"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DCFB448E136F7202004B3EE0"
BuildableName = "EmbedReader.app"
BlueprintName = "EmbedReader"
ReferencedContainer = "container:EmbedReader.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Workspace version="1.0"><FileRef location="group:EmbedReader.xcodeproj"></FileRef><FileRef location="group:Pods/Pods.xcodeproj"></FileRef></Workspace>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>net.sourceforge.zbar.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
<string>MainWindow</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
#import <Availability.h>
#ifndef __IPHONE_3_0
#warning "This project uses features only available in iPhone SDK 3.0 and later."
#endif
#ifdef __OBJC__
# import <UIKit/UIKit.h>
# import <Foundation/Foundation.h>
# import "ZBarSDK.h"
#endif
//
// EmbedReaderAppDelegate.h
// EmbedReader
//
// Created by spadix on 5/2/11.
//
#import <UIKit/UIKit.h>
@class EmbedReaderViewController;
@interface EmbedReaderAppDelegate
: NSObject
< UIApplicationDelegate >
{
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet EmbedReaderViewController *viewController;
@end
//
// EmbedReaderAppDelegate.m
// EmbedReader
//
// Created by spadix on 5/2/11.
//
#import "EmbedReaderAppDelegate.h"
#import "EmbedReaderViewController.h"
@implementation EmbedReaderAppDelegate
@synthesize window=_window;
@synthesize viewController=_viewController;
- (BOOL) application: (UIApplication*) application
didFinishLaunchingWithOptions: (NSDictionary*) launchOptions
{
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
// force view class to load so it may be referenced directly from NIB
[ZBarReaderView class];
return(YES);
}
- (void) dealloc
{
[_window release];
[_viewController release];
[super dealloc];
}
@end
//
// EmbedReaderViewController.h
// EmbedReader
//
// Created by spadix on 5/2/11.
//
#import <UIKit/UIKit.h>
@interface EmbedReaderViewController
: UIViewController
< ZBarReaderViewDelegate >
{
ZBarReaderView *readerView;
UITextView *resultText;
ZBarCameraSimulator *cameraSim;
}
@property (nonatomic, retain) IBOutlet ZBarReaderView *readerView;
@property (nonatomic, retain) IBOutlet UITextView *resultText;
@end
//
// EmbedReaderViewController.m
// EmbedReader
//
// Created by spadix on 5/2/11.
//
#import "EmbedReaderViewController.h"
@implementation EmbedReaderViewController
@synthesize readerView, resultText;
- (void) cleanup
{
[cameraSim release];
cameraSim = nil;
readerView.readerDelegate = nil;
[readerView release];
readerView = nil;
[resultText release];
resultText = nil;
}
- (void) dealloc
{
[self cleanup];
[super dealloc];
}
- (void) viewDidLoad
{
[super viewDidLoad];
// the delegate receives decode results
readerView.readerDelegate = self;
// you can use this to support the simulator
if(TARGET_IPHONE_SIMULATOR) {
cameraSim = [[ZBarCameraSimulator alloc]
initWithViewController: self];
cameraSim.readerView = readerView;
}
}
- (void) viewDidUnload
{
[self cleanup];
[super viewDidUnload];
}
- (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) orient
{
// auto-rotation is supported
return(YES);
}
- (void) willRotateToInterfaceOrientation: (UIInterfaceOrientation) orient
duration: (NSTimeInterval) duration
{
// compensate for view rotation so camera preview is not rotated
[readerView willRotateToInterfaceOrientation: orient
duration: duration];
}
- (void) viewDidAppear: (BOOL) animated
{
// run the reader when the view is visible
[readerView start];
}
- (void) viewWillDisappear: (BOOL) animated
{
[readerView stop];
}
- (void) readerView: (ZBarReaderView*) view
didReadSymbols: (ZBarSymbolSet*) syms
fromImage: (UIImage*) img
{
// do something useful with results
for(ZBarSymbol *sym in syms) {
resultText.text = sym.data;
break;
}
}
@end
/* Localized versions of Info.plist keys */
This diff is collapsed.
//
// main.m
// EmbedReader
//
// Created by spadix on 5/2/11.
//
#import <UIKit/UIKit.h>
int main(int argc, char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
platform :ios
dependency 'ZBarSDK'
PODS:
- ZBarSDK (1.2.2)
DEPENDENCIES:
- ZBarSDK
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment