Fixed Location & Storage issues

This commit is contained in:
2024-05-25 11:05:02 +09:00
parent e55674e1b9
commit 6a49aed98d
861 changed files with 80074 additions and 402 deletions

View File

@ -0,0 +1,46 @@
<?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>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>MTBBarcodeScanner.framework/MTBBarcodeScanner</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>MTBBarcodeScanner.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>MTBBarcodeScanner.framework/MTBBarcodeScanner</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>MTBBarcodeScanner.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>

View File

@ -0,0 +1,17 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "MTBBarcodeScanner.h"
FOUNDATION_EXPORT double MTBBarcodeScannerVersionNumber;
FOUNDATION_EXPORT const unsigned char MTBBarcodeScannerVersionString[];

View File

@ -0,0 +1,330 @@
//
// MTBBarcodeScanner.h
// MTBBarcodeScannerExample
//
// Created by Mike Buss on 2/8/14.
//
//
#import <AVFoundation/AVFoundation.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, MTBCamera) {
MTBCameraBack,
MTBCameraFront
};
/**
* Available torch modes when scanning barcodes.
*
* While AVFoundation provides an additional automatic
* mode, it is not supported here because it only works
* with video recordings, not barcode scanning.
*/
typedef NS_ENUM(NSUInteger, MTBTorchMode) {
MTBTorchModeOff,
MTBTorchModeOn,
};
@interface MTBBarcodeScanner : NSObject
/**
* The currently set camera. See MTBCamera for options.
*
* @sa setCamera:error:
*/
@property (nonatomic, assign, readonly) MTBCamera camera;
/**
* Control the torch on the device, if present.
*
* Attempting to set the torch mode to an unsupported state
* will fail silently, and the value passed into the setter
* will be discarded.
*
* @sa setTorchMode:error:
*/
@property (nonatomic, assign) MTBTorchMode torchMode;
/**
* Allow the user to tap the previewView to focus a specific area.
* Defaults to YES.
*/
@property (nonatomic, assign) BOOL allowTapToFocus;
/**
* If set, only barcodes inside this area will be scanned.
*
* Setting this property is only supported while the scanner is active.
* Use the didStartScanningBlock if you want to set it as early as
* possible.
*/
@property (nonatomic, assign) CGRect scanRect;
/**
* Layer used to present the camera input. If the previewView
* does not use auto layout, it may be necessary to adjust the layers frame.
*/
@property (nonatomic, strong) CALayer *previewLayer;
/*!
@property didStartScanningBlock
@abstract
Optional callback block that's called when the scanner finished initializing.
@discussion
Optional callback that will be called when the scanner is initialized and the view
is presented on the screen. This is useful for presenting an activity indicator
while the scanner is initializing.
The block is always called on the main queue.
*/
@property (nonatomic, copy) void (^didStartScanningBlock)(void);
/*!
@property didTapToFocusBlock
@abstract
Block that's called when the user taps the screen to focus the camera. If allowsTapToFocus
is set to NO, this will never be called.
*/
@property (nonatomic, copy) void (^didTapToFocusBlock)(CGPoint point);
/*!
@property resultBlock
@abstract
Block that's called every time one or more barcodes are recognized.
@discussion
The resultBlock is called on the main queue once for every frame that at least one valid barcode is found.
This block is automatically set when you call startScanningWithResultBlock:
*/
@property (nonatomic, copy) void (^resultBlock)(NSArray<AVMetadataMachineReadableCodeObject *> *codes);
/*!
@property preferredAutoFocusRangeRestriction
@abstract
Auto focus range restriction, if supported.
@discussion
Defaults to AVCaptureAutoFocusRangeRestrictionNear. Will be ignored on unsupported devices.
*/
@property (nonatomic, assign) AVCaptureAutoFocusRangeRestriction preferredAutoFocusRangeRestriction;
/**
* Initialize a scanner that will feed the camera input
* into the given UIView.
*
* @param previewView View that will be overlayed with the live feed from the camera input.
*
* @return An instance of MTBBarcodeScanner
*/
- (instancetype)initWithPreviewView:(UIView *)previewView;
/**
* Initialize a scanner that will feed the camera input
* into the given UIView. Only codes with a type given in
* the metaDataObjectTypes array will be reported to the result
* block when scanning is started using startScanningWithResultBlock:
*
* @see startScanningWithResultBlock:
*
* @param metaDataObjectTypes Array of AVMetadataObjectTypes to scan for. Only codes with types given in this array will be reported to the resultBlock.
* @param previewView View that will be overlayed with the live feed from the camera input.
*
* @return An instance of MTBBarcodeScanner
*/
- (instancetype)initWithMetadataObjectTypes:(NSArray<NSString *> *)metaDataObjectTypes
previewView:(UIView *)previewView;
/**
* Returns whether any camera exists in this device.
* Be aware that this returns NO if camera access is restricted.
*
* @return YES if the device has a camera and authorization state is not AVAuthorizationStatusRestricted
*/
+ (BOOL)cameraIsPresent;
/**
* You can use this flag to check whether flipCamera can potentially
* be successful. You may want to hide your button to flip the camera
* if the device only has one camera.
*
* @return YES if a second camera is present and authorization state is not AVAuthorizationStatusRestricted.
* @sa flipCamera
*/
- (BOOL)hasOppositeCamera;
/**
* Returns whether scanning is prohibited by the user of the device.
*
* @return YES if the user has prohibited access to (or is prohibited from accessing) the camera.
*/
+ (BOOL)scanningIsProhibited;
/**
* Request permission to access the camera on the device.
*
* The success block will return YES if the user granted permission, has granted permission in the past, or if the device is running iOS 7.
* The success block will return NO if the user denied permission, is restricted from the camera, or if there is no camera present.
*/
+ (void)requestCameraPermissionWithSuccess:(void (^)(BOOL success))successBlock;
/**
* Start scanning for barcodes. The camera input will be added as a sublayer
* to the UIView given for previewView during initialization.
*
* This method assumes you have already set the `resultBlock` property directly.
*
* This method returns quickly and does not wait for the internal session to
* start. Set the didStartScanningBlock to get a callback when the session
* is ready, i.e., a camera picture is visible.
*
* @param error Error supplied if the scanning could not start.
*
* @return YES if scanning started successfully, NO if there was an error.
*/
- (BOOL)startScanningWithError:(NSError **)error;
/**
* Start scanning for barcodes. The camera input will be added as a sublayer
* to the UIView given for previewView during initialization.
*
* This method returns quickly and does not wait for the internal session to
* start. Set the didStartScanningBlock to get a callback when the session
* is ready, i.e., a camera picture is visible.
*
* @param resultBlock Callback block for captured codes. If the scanner was instantiated with initWithMetadataObjectTypes:previewView, only codes with a type given in metaDataObjectTypes will be reported.
* @param error Error supplied if the scanning could not start.
*
* @return YES if scanning started successfully, NO if there was an error.
*/
- (BOOL)startScanningWithResultBlock:(void (^)(NSArray<AVMetadataMachineReadableCodeObject *> *codes))resultBlock error:(NSError **)error;
/**
* Start scanning for barcodes using a specific camera. The camera input will be added as a sublayer
* to the UIView given for previewView during initialization.
*
* This method returns quickly and does not wait for the internal session to
* start. Set the didStartScanningBlock to get a callback when the session
* is ready, i.e., a camera picture is visible.
*
* @param camera The camera to use when scanning starts.
* @param resultBlock Callback block for captured codes. If the scanner was instantiated with initWithMetadataObjectTypes:previewView, only codes with a type given in metaDataObjectTypes will be reported.
* @param error Error supplied if the scanning could not start.
*
*
* @return YES if scanning started successfully, NO if there was an error.
*/
- (BOOL)startScanningWithCamera:(MTBCamera)camera resultBlock:(void (^)(NSArray<AVMetadataMachineReadableCodeObject *> *codes))resultBlock error:(NSError **)error;
/**
* Stop scanning for barcodes. The live feed from the camera will be removed as a sublayer from the previewView given during initialization.
*/
- (void)stopScanning;
/**
* Whether the scanner is currently scanning for barcodes
*
* @return YES if the scanner is currently scanning for barcodes
*/
- (BOOL)isScanning;
/**
* If using the front camera, switch to the back, or visa-versa.
* If this method is called when isScanning=NO, it has no effect
*
* If the opposite camera is not available, this method will do nothing.
*
* @sa hasOppositeCamera
*/
- (void)flipCamera;
/**
* Sets the camera and ignores any errors.
*
* Deprecated.
*
* @sa setCamera:error:
*/
- (void)setCamera:(MTBCamera)camera NS_DEPRECATED_IOS(2.0, 2.0, "Use setCamera:error: instead");
/**
* Sets the camera. This operation may fail, e.g., when the device
* does not have the specified camera.
*
* @param camera The camera to use, see MTBCamera for options.
* @error Any error that occurred while trying to set the camera.
* @return YES, if the specified camera was set successfully, NO if any error occurred.
*/
- (BOOL)setCamera:(MTBCamera)camera error:(NSError **)error;
/**
* If using the front camera, switch to the back, or visa-versa.
*
* If this method is called when (isScanning == NO), it will return
* NO and provide an error.
*
* If the opposite camera is not available, the error parameter
* will explain the error.
*
* @return YES if the camera was flipped, NO if any error occurred.
*/
- (BOOL)flipCameraWithError:(NSError **)error;
/**
* Return a BOOL value that specifies whether the current capture device has a torch.
*
* @return YES if the the current capture device has a torch.
*/
- (BOOL)hasTorch;
/**
* Toggle the torch from on to off, or off to on.
* If the device does not support a torch or the opposite mode, calling
* this method will have no effect.
* To set the torch to on/off directly, set the `torchMode` property, or
* use setTorchMode:error: if you care about errors.
*/
- (void)toggleTorch;
/**
* Attempts to set a new torch mode.
*
* @return YES, if setting the new mode was successful, and the torchMode
* property reflects the new state. NO if there was an error - use the
* error parameter to learn about the reason.
*
* @sa torchMode
*/
- (BOOL)setTorchMode:(MTBTorchMode)torchMode error:(NSError **)error;
/**
* Freeze capture keeping the last frame on previewView.
* If this method is called before startScanning, it has no effect.
*
* Returns immediately actually freezing the capture is
* done asynchronously.
*/
- (void)freezeCapture;
/**
* Unfreeze a frozen capture.
*
* Returns immediately actually unfreezing the capture is
* done asynchronously.
*/
- (void)unfreezeCapture;
/**
* Captures a still image of the current camera feed
*/
- (void)captureStillImage:(void (^)(UIImage *image, NSError *error))captureBlock;
/**
* Determine if currently capturing a still image
*/
- (BOOL)isCapturingStillImage;
@end

View File

@ -0,0 +1,6 @@
framework module MTBBarcodeScanner {
umbrella header "MTBBarcodeScanner-umbrella.h"
export *
module * { export * }
}

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.org.cocoapods.MTBBarcodeScanner</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>5.0.11</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -0,0 +1,123 @@
---
triple: 'arm64-apple-darwin'
binary-path: '/Volumes/PortableSSD1TB/main/GifuTabi/rog_app/Flutter/Release/iphoneos/Release-iphoneos/MTBBarcodeScanner/MTBBarcodeScanner.framework/MTBBarcodeScanner'
relocations:
- { offsetInCU: 0x34, offset: 0x6C692, size: 0x8, addend: 0x0, symName: _MTBBarcodeScannerVersionString, symObjAddr: 0x0, symBinAddr: 0xCF68, symSize: 0x0 }
- { offsetInCU: 0x69, offset: 0x6C6C7, size: 0x8, addend: 0x0, symName: _MTBBarcodeScannerVersionNumber, symObjAddr: 0x30, symBinAddr: 0xCF98, symSize: 0x0 }
- { offsetInCU: 0x27, offset: 0x6C704, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner init]', symObjAddr: 0x0, symBinAddr: 0x8000, symSize: 0x18 }
- { offsetInCU: 0x41, offset: 0x6C71E, size: 0x8, addend: 0x0, symName: _kFocalPointOfInterestX, symObjAddr: 0x34D8, symBinAddr: 0xCFB0, symSize: 0x0 }
- { offsetInCU: 0x63, offset: 0x6C740, size: 0x8, addend: 0x0, symName: _kFocalPointOfInterestY, symObjAddr: 0x34E0, symBinAddr: 0xCFB8, symSize: 0x0 }
- { offsetInCU: 0x569, offset: 0x6CC46, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner init]', symObjAddr: 0x0, symBinAddr: 0x8000, symSize: 0x18 }
- { offsetInCU: 0x5A0, offset: 0x6CC7D, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner initWithPreviewView:]', symObjAddr: 0x18, symBinAddr: 0x8018, symSize: 0x6C }
- { offsetInCU: 0x5E7, offset: 0x6CCC4, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner initWithMetadataObjectTypes:previewView:]', symObjAddr: 0x84, symBinAddr: 0x8084, symSize: 0xB8 }
- { offsetInCU: 0x63E, offset: 0x6CD1B, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner dealloc]', symObjAddr: 0x13C, symBinAddr: 0x813C, symSize: 0x68 }
- { offsetInCU: 0x671, offset: 0x6CD4E, size: 0x8, addend: 0x0, symName: '+[MTBBarcodeScanner cameraIsPresent]', symObjAddr: 0x1A4, symBinAddr: 0x81A4, symSize: 0x48 }
- { offsetInCU: 0x6A4, offset: 0x6CD81, size: 0x8, addend: 0x0, symName: '+[MTBBarcodeScanner hasCamera:]', symObjAddr: 0x1EC, symBinAddr: 0x81EC, symSize: 0x184 }
- { offsetInCU: 0x731, offset: 0x6CE0E, size: 0x8, addend: 0x0, symName: '+[MTBBarcodeScanner oppositeCameraOf:]', symObjAddr: 0x370, symBinAddr: 0x8370, symSize: 0xC }
- { offsetInCU: 0x772, offset: 0x6CE4F, size: 0x8, addend: 0x0, symName: '+[MTBBarcodeScanner scanningIsProhibited]', symObjAddr: 0x37C, symBinAddr: 0x837C, symSize: 0x34 }
- { offsetInCU: 0x7A5, offset: 0x6CE82, size: 0x8, addend: 0x0, symName: '+[MTBBarcodeScanner requestCameraPermissionWithSuccess:]', symObjAddr: 0x3B0, symBinAddr: 0x83B0, symSize: 0xF8 }
- { offsetInCU: 0x7F4, offset: 0x6CED1, size: 0x8, addend: 0x0, symName: '___56+[MTBBarcodeScanner requestCameraPermissionWithSuccess:]_block_invoke', symObjAddr: 0x4A8, symBinAddr: 0x84A8, symSize: 0x78 }
- { offsetInCU: 0x867, offset: 0x6CF44, size: 0x8, addend: 0x0, symName: '___56+[MTBBarcodeScanner requestCameraPermissionWithSuccess:]_block_invoke_2', symObjAddr: 0x520, symBinAddr: 0x8520, symSize: 0x14 }
- { offsetInCU: 0x8C1, offset: 0x6CF9E, size: 0x8, addend: 0x0, symName: ___copy_helper_block_e8_32b, symObjAddr: 0x534, symBinAddr: 0x8534, symSize: 0x10 }
- { offsetInCU: 0x8EA, offset: 0x6CFC7, size: 0x8, addend: 0x0, symName: ___destroy_helper_block_e8_32s, symObjAddr: 0x544, symBinAddr: 0x8544, symSize: 0x8 }
- { offsetInCU: 0x909, offset: 0x6CFE6, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner startScanningWithError:]', symObjAddr: 0x54C, symBinAddr: 0x854C, symSize: 0x58 }
- { offsetInCU: 0x952, offset: 0x6D02F, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner startScanningWithResultBlock:error:]', symObjAddr: 0x5A4, symBinAddr: 0x85A4, symSize: 0x10 }
- { offsetInCU: 0x9AA, offset: 0x6D087, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner startScanningWithCamera:resultBlock:error:]', symObjAddr: 0x5B4, symBinAddr: 0x85B4, symSize: 0x2D4 }
- { offsetInCU: 0xA3C, offset: 0x6D119, size: 0x8, addend: 0x0, symName: '___63-[MTBBarcodeScanner startScanningWithCamera:resultBlock:error:]_block_invoke', symObjAddr: 0x888, symBinAddr: 0x8888, symSize: 0x108 }
- { offsetInCU: 0xA94, offset: 0x6D171, size: 0x8, addend: 0x0, symName: '___63-[MTBBarcodeScanner startScanningWithCamera:resultBlock:error:]_block_invoke_2', symObjAddr: 0x990, symBinAddr: 0x8990, symSize: 0x38 }
- { offsetInCU: 0xAE2, offset: 0x6D1BF, size: 0x8, addend: 0x0, symName: ___copy_helper_block_e8_32s, symObjAddr: 0x9C8, symBinAddr: 0x89C8, symSize: 0x8 }
- { offsetInCU: 0xB09, offset: 0x6D1E6, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner stopScanning]', symObjAddr: 0x9D0, symBinAddr: 0x89D0, symSize: 0x17C }
- { offsetInCU: 0xB7C, offset: 0x6D259, size: 0x8, addend: 0x0, symName: '___33-[MTBBarcodeScanner stopScanning]_block_invoke', symObjAddr: 0xB4C, symBinAddr: 0x8B4C, symSize: 0x110 }
- { offsetInCU: 0xBF8, offset: 0x6D2D5, size: 0x8, addend: 0x0, symName: ___copy_helper_block_e8_32s40s48s, symObjAddr: 0xC5C, symBinAddr: 0x8C5C, symSize: 0x30 }
- { offsetInCU: 0xC21, offset: 0x6D2FE, size: 0x8, addend: 0x0, symName: ___destroy_helper_block_e8_32s40s48s, symObjAddr: 0xC8C, symBinAddr: 0x8C8C, symSize: 0x30 }
- { offsetInCU: 0xC40, offset: 0x6D31D, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner isScanning]', symObjAddr: 0xCBC, symBinAddr: 0x8CBC, symSize: 0x3C }
- { offsetInCU: 0xC78, offset: 0x6D355, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner hasOppositeCamera]', symObjAddr: 0xCF8, symBinAddr: 0x8CF8, symSize: 0x48 }
- { offsetInCU: 0xCC1, offset: 0x6D39E, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner flipCamera]', symObjAddr: 0xD40, symBinAddr: 0x8D40, symSize: 0x8 }
- { offsetInCU: 0xCF3, offset: 0x6D3D0, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner flipCameraWithError:]', symObjAddr: 0xD48, symBinAddr: 0x8D48, symSize: 0x138 }
- { offsetInCU: 0xD4D, offset: 0x6D42A, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner configureTapToFocus]', symObjAddr: 0xE80, symBinAddr: 0x8E80, symSize: 0x90 }
- { offsetInCU: 0xDA1, offset: 0x6D47E, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner focusTapped:]', symObjAddr: 0xF10, symBinAddr: 0x8F10, symSize: 0x1AC }
- { offsetInCU: 0xE32, offset: 0x6D50F, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner stopRecognizingTaps]', symObjAddr: 0x10BC, symBinAddr: 0x90BC, symSize: 0x80 }
- { offsetInCU: 0xE66, offset: 0x6D543, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner captureOutput:didOutputMetadataObjects:fromConnection:]', symObjAddr: 0x113C, symBinAddr: 0x913C, symSize: 0x1B8 }
- { offsetInCU: 0xF22, offset: 0x6D5FF, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner handleApplicationDidChangeStatusBarNotification:]', symObjAddr: 0x12F4, symBinAddr: 0x92F4, symSize: 0x4 }
- { offsetInCU: 0xF61, offset: 0x6D63E, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner refreshVideoOrientation]', symObjAddr: 0x12F8, symBinAddr: 0x92F8, symSize: 0x168 }
- { offsetInCU: 0xFA6, offset: 0x6D683, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner captureOrientationForInterfaceOrientation:]', symObjAddr: 0x1460, symBinAddr: 0x9460, symSize: 0x10 }
- { offsetInCU: 0xFE9, offset: 0x6D6C6, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner applicationWillEnterForegroundNotification:]', symObjAddr: 0x1470, symBinAddr: 0x9470, symSize: 0x2C }
- { offsetInCU: 0x102A, offset: 0x6D707, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner newSessionWithCaptureDevice:error:]', symObjAddr: 0x149C, symBinAddr: 0x949C, symSize: 0x4C0 }
- { offsetInCU: 0x10BC, offset: 0x6D799, size: 0x8, addend: 0x0, symName: '___55-[MTBBarcodeScanner newSessionWithCaptureDevice:error:]_block_invoke', symObjAddr: 0x195C, symBinAddr: 0x995C, symSize: 0x7C }
- { offsetInCU: 0x10FE, offset: 0x6D7DB, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner newCaptureDeviceWithCamera:]', symObjAddr: 0x19D8, symBinAddr: 0x99D8, symSize: 0x230 }
- { offsetInCU: 0x11D6, offset: 0x6D8B3, size: 0x8, addend: 0x0, symName: '+[MTBBarcodeScanner devicePositionForCamera:]', symObjAddr: 0x1C08, symBinAddr: 0x9C08, symSize: 0x18 }
- { offsetInCU: 0x1219, offset: 0x6D8F6, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner defaultMetaDataObjectTypes]', symObjAddr: 0x1C20, symBinAddr: 0x9C20, symSize: 0x1A4 }
- { offsetInCU: 0x125E, offset: 0x6D93B, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner addObservers]', symObjAddr: 0x1DC4, symBinAddr: 0x9DC4, symSize: 0x9C }
- { offsetInCU: 0x1292, offset: 0x6D96F, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setupSessionQueue]', symObjAddr: 0x1E60, symBinAddr: 0x9E60, symSize: 0x64 }
- { offsetInCU: 0x12FD, offset: 0x6D9DA, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setDeviceInput:session:]', symObjAddr: 0x1EC4, symBinAddr: 0x9EC4, symSize: 0xC4 }
- { offsetInCU: 0x1353, offset: 0x6DA30, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner removeDeviceInput:session:]', symObjAddr: 0x1F88, symBinAddr: 0x9F88, symSize: 0x94 }
- { offsetInCU: 0x13A9, offset: 0x6DA86, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner updateFocusPreferencesOfDevice:reset:]', symObjAddr: 0x201C, symBinAddr: 0xA01C, symSize: 0x154 }
- { offsetInCU: 0x1410, offset: 0x6DAED, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setTorchMode:]', symObjAddr: 0x2170, symBinAddr: 0xA170, symSize: 0x8 }
- { offsetInCU: 0x1451, offset: 0x6DB2E, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setTorchMode:error:]', symObjAddr: 0x2178, symBinAddr: 0xA178, symSize: 0x2C }
- { offsetInCU: 0x14AB, offset: 0x6DB88, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner toggleTorch]', symObjAddr: 0x21A4, symBinAddr: 0xA1A4, symSize: 0x48 }
- { offsetInCU: 0x14DF, offset: 0x6DBBC, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner updateForTorchMode:error:]', symObjAddr: 0x21EC, symBinAddr: 0xA1EC, symSize: 0x174 }
- { offsetInCU: 0x155B, offset: 0x6DC38, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner hasTorch]', symObjAddr: 0x2360, symBinAddr: 0xA360, symSize: 0x98 }
- { offsetInCU: 0x15C6, offset: 0x6DCA3, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner avTorchModeForMTBTorchMode:]', symObjAddr: 0x23F8, symBinAddr: 0xA3F8, symSize: 0xC }
- { offsetInCU: 0x1609, offset: 0x6DCE6, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner freezeCapture]', symObjAddr: 0x2404, symBinAddr: 0xA404, symSize: 0xC8 }
- { offsetInCU: 0x166B, offset: 0x6DD48, size: 0x8, addend: 0x0, symName: '___34-[MTBBarcodeScanner freezeCapture]_block_invoke', symObjAddr: 0x24CC, symBinAddr: 0xA4CC, symSize: 0x44 }
- { offsetInCU: 0x16BE, offset: 0x6DD9B, size: 0x8, addend: 0x0, symName: ___copy_helper_block_e8_32s40s, symObjAddr: 0x2510, symBinAddr: 0xA510, symSize: 0x28 }
- { offsetInCU: 0x16E7, offset: 0x6DDC4, size: 0x8, addend: 0x0, symName: ___destroy_helper_block_e8_32s40s, symObjAddr: 0x2538, symBinAddr: 0xA538, symSize: 0x28 }
- { offsetInCU: 0x1706, offset: 0x6DDE3, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner unfreezeCapture]', symObjAddr: 0x2560, symBinAddr: 0xA560, symSize: 0x154 }
- { offsetInCU: 0x1768, offset: 0x6DE45, size: 0x8, addend: 0x0, symName: '___36-[MTBBarcodeScanner unfreezeCapture]_block_invoke', symObjAddr: 0x26B4, symBinAddr: 0xA6B4, symSize: 0x44 }
- { offsetInCU: 0x17BB, offset: 0x6DE98, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner captureStillImage:]', symObjAddr: 0x26F8, symBinAddr: 0xA6F8, symSize: 0x314 }
- { offsetInCU: 0x18D7, offset: 0x6DFB4, size: 0x8, addend: 0x0, symName: '___39-[MTBBarcodeScanner captureStillImage:]_block_invoke', symObjAddr: 0x2A0C, symBinAddr: 0xAA0C, symSize: 0x48 }
- { offsetInCU: 0x193B, offset: 0x6E018, size: 0x8, addend: 0x0, symName: ___copy_helper_block_e8_32s40s48b, symObjAddr: 0x2A54, symBinAddr: 0xAA54, symSize: 0x3C }
- { offsetInCU: 0x1964, offset: 0x6E041, size: 0x8, addend: 0x0, symName: '___39-[MTBBarcodeScanner captureStillImage:]_block_invoke.46', symObjAddr: 0x2A90, symBinAddr: 0xAA90, symSize: 0xA0 }
- { offsetInCU: 0x1A22, offset: 0x6E0FF, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner captureOutput:didFinishProcessingPhoto:error:]', symObjAddr: 0x2B30, symBinAddr: 0xAB30, symSize: 0x1B8 }
- { offsetInCU: 0x1B03, offset: 0x6E1E0, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner captureOutput:didFinishProcessingPhotoSampleBuffer:previewPhotoSampleBuffer:resolvedSettings:bracketSettings:error:]', symObjAddr: 0x2CE8, symBinAddr: 0xACE8, symSize: 0xE8 }
- { offsetInCU: 0x1BCE, offset: 0x6E2AB, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner isCapturingStillImage]', symObjAddr: 0x2DD0, symBinAddr: 0xADD0, symSize: 0x3C }
- { offsetInCU: 0x1C06, offset: 0x6E2E3, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setCamera:]', symObjAddr: 0x2E0C, symBinAddr: 0xAE0C, symSize: 0x8 }
- { offsetInCU: 0x1C47, offset: 0x6E324, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setCamera:error:]', symObjAddr: 0x2E14, symBinAddr: 0xAE14, symSize: 0x184 }
- { offsetInCU: 0x1CC3, offset: 0x6E3A0, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setScanRect:]', symObjAddr: 0x2F98, symBinAddr: 0xAF98, symSize: 0xB0 }
- { offsetInCU: 0x1D1E, offset: 0x6E3FB, size: 0x8, addend: 0x0, symName: '___33-[MTBBarcodeScanner setScanRect:]_block_invoke', symObjAddr: 0x3048, symBinAddr: 0xB048, symSize: 0x94 }
- { offsetInCU: 0x1D60, offset: 0x6E43D, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setPreferredAutoFocusRangeRestriction:]', symObjAddr: 0x30DC, symBinAddr: 0xB0DC, symSize: 0x9C }
- { offsetInCU: 0x1DA5, offset: 0x6E482, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner previewLayer]', symObjAddr: 0x3178, symBinAddr: 0xB178, symSize: 0x4 }
- { offsetInCU: 0x1DDB, offset: 0x6E4B8, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner rectOfInterestFromScanRect:]', symObjAddr: 0x317C, symBinAddr: 0xB17C, symSize: 0x98 }
- { offsetInCU: 0x1E51, offset: 0x6E52E, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner camera]', symObjAddr: 0x3214, symBinAddr: 0xB214, symSize: 0x8 }
- { offsetInCU: 0x1E88, offset: 0x6E565, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner torchMode]', symObjAddr: 0x321C, symBinAddr: 0xB21C, symSize: 0x8 }
- { offsetInCU: 0x1EBF, offset: 0x6E59C, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner allowTapToFocus]', symObjAddr: 0x3224, symBinAddr: 0xB224, symSize: 0x8 }
- { offsetInCU: 0x1EF6, offset: 0x6E5D3, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setAllowTapToFocus:]', symObjAddr: 0x322C, symBinAddr: 0xB22C, symSize: 0x8 }
- { offsetInCU: 0x1F31, offset: 0x6E60E, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner scanRect]', symObjAddr: 0x3234, symBinAddr: 0xB234, symSize: 0xC }
- { offsetInCU: 0x1F66, offset: 0x6E643, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setPreviewLayer:]', symObjAddr: 0x3240, symBinAddr: 0xB240, symSize: 0xC }
- { offsetInCU: 0x1FA7, offset: 0x6E684, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner didStartScanningBlock]', symObjAddr: 0x324C, symBinAddr: 0xB24C, symSize: 0x8 }
- { offsetInCU: 0x1FDE, offset: 0x6E6BB, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setDidStartScanningBlock:]', symObjAddr: 0x3254, symBinAddr: 0xB254, symSize: 0x8 }
- { offsetInCU: 0x201D, offset: 0x6E6FA, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner didTapToFocusBlock]', symObjAddr: 0x325C, symBinAddr: 0xB25C, symSize: 0x8 }
- { offsetInCU: 0x2054, offset: 0x6E731, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setDidTapToFocusBlock:]', symObjAddr: 0x3264, symBinAddr: 0xB264, symSize: 0x8 }
- { offsetInCU: 0x2093, offset: 0x6E770, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner resultBlock]', symObjAddr: 0x326C, symBinAddr: 0xB26C, symSize: 0x8 }
- { offsetInCU: 0x20CA, offset: 0x6E7A7, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setResultBlock:]', symObjAddr: 0x3274, symBinAddr: 0xB274, symSize: 0x8 }
- { offsetInCU: 0x2109, offset: 0x6E7E6, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner preferredAutoFocusRangeRestriction]', symObjAddr: 0x327C, symBinAddr: 0xB27C, symSize: 0x8 }
- { offsetInCU: 0x2140, offset: 0x6E81D, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner privateSessionQueue]', symObjAddr: 0x3284, symBinAddr: 0xB284, symSize: 0xC }
- { offsetInCU: 0x2177, offset: 0x6E854, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setPrivateSessionQueue:]', symObjAddr: 0x3290, symBinAddr: 0xB290, symSize: 0x8 }
- { offsetInCU: 0x21B6, offset: 0x6E893, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner session]', symObjAddr: 0x3298, symBinAddr: 0xB298, symSize: 0x8 }
- { offsetInCU: 0x21ED, offset: 0x6E8CA, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setSession:]', symObjAddr: 0x32A0, symBinAddr: 0xB2A0, symSize: 0xC }
- { offsetInCU: 0x222E, offset: 0x6E90B, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner captureDevice]', symObjAddr: 0x32AC, symBinAddr: 0xB2AC, symSize: 0x8 }
- { offsetInCU: 0x2265, offset: 0x6E942, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setCaptureDevice:]', symObjAddr: 0x32B4, symBinAddr: 0xB2B4, symSize: 0xC }
- { offsetInCU: 0x22A6, offset: 0x6E983, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner capturePreviewLayer]', symObjAddr: 0x32C0, symBinAddr: 0xB2C0, symSize: 0x8 }
- { offsetInCU: 0x22DD, offset: 0x6E9BA, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setCapturePreviewLayer:]', symObjAddr: 0x32C8, symBinAddr: 0xB2C8, symSize: 0xC }
- { offsetInCU: 0x231E, offset: 0x6E9FB, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner currentCaptureDeviceInput]', symObjAddr: 0x32D4, symBinAddr: 0xB2D4, symSize: 0x8 }
- { offsetInCU: 0x2355, offset: 0x6EA32, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setCurrentCaptureDeviceInput:]', symObjAddr: 0x32DC, symBinAddr: 0xB2DC, symSize: 0xC }
- { offsetInCU: 0x2396, offset: 0x6EA73, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner captureOutput]', symObjAddr: 0x32E8, symBinAddr: 0xB2E8, symSize: 0x8 }
- { offsetInCU: 0x23CD, offset: 0x6EAAA, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setCaptureOutput:]', symObjAddr: 0x32F0, symBinAddr: 0xB2F0, symSize: 0xC }
- { offsetInCU: 0x240E, offset: 0x6EAEB, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner metaDataObjectTypes]', symObjAddr: 0x32FC, symBinAddr: 0xB2FC, symSize: 0x8 }
- { offsetInCU: 0x2445, offset: 0x6EB22, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setMetaDataObjectTypes:]', symObjAddr: 0x3304, symBinAddr: 0xB304, symSize: 0x8 }
- { offsetInCU: 0x2484, offset: 0x6EB61, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner previewView]', symObjAddr: 0x330C, symBinAddr: 0xB30C, symSize: 0x18 }
- { offsetInCU: 0x24BB, offset: 0x6EB98, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setPreviewView:]', symObjAddr: 0x3324, symBinAddr: 0xB324, symSize: 0xC }
- { offsetInCU: 0x24FC, offset: 0x6EBD9, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner initialAutoFocusRangeRestriction]', symObjAddr: 0x3330, symBinAddr: 0xB330, symSize: 0x8 }
- { offsetInCU: 0x2533, offset: 0x6EC10, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setInitialAutoFocusRangeRestriction:]', symObjAddr: 0x3338, symBinAddr: 0xB338, symSize: 0x8 }
- { offsetInCU: 0x2570, offset: 0x6EC4D, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner initialFocusPoint]', symObjAddr: 0x3340, symBinAddr: 0xB340, symSize: 0x8 }
- { offsetInCU: 0x25A5, offset: 0x6EC82, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setInitialFocusPoint:]', symObjAddr: 0x3348, symBinAddr: 0xB348, symSize: 0x8 }
- { offsetInCU: 0x25E4, offset: 0x6ECC1, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner stillImageOutput]', symObjAddr: 0x3350, symBinAddr: 0xB350, symSize: 0x8 }
- { offsetInCU: 0x261B, offset: 0x6ECF8, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setStillImageOutput:]', symObjAddr: 0x3358, symBinAddr: 0xB358, symSize: 0xC }
- { offsetInCU: 0x265C, offset: 0x6ED39, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner gestureRecognizer]', symObjAddr: 0x3364, symBinAddr: 0xB364, symSize: 0x8 }
- { offsetInCU: 0x2693, offset: 0x6ED70, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setGestureRecognizer:]', symObjAddr: 0x336C, symBinAddr: 0xB36C, symSize: 0xC }
- { offsetInCU: 0x26D4, offset: 0x6EDB1, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner stillImageCaptureBlock]', symObjAddr: 0x3378, symBinAddr: 0xB378, symSize: 0x8 }
- { offsetInCU: 0x270B, offset: 0x6EDE8, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setStillImageCaptureBlock:]', symObjAddr: 0x3380, symBinAddr: 0xB380, symSize: 0x8 }
- { offsetInCU: 0x274A, offset: 0x6EE27, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner output]', symObjAddr: 0x3388, symBinAddr: 0xB388, symSize: 0x8 }
- { offsetInCU: 0x2781, offset: 0x6EE5E, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner setOutput:]', symObjAddr: 0x3390, symBinAddr: 0xB390, symSize: 0xC }
- { offsetInCU: 0x27C2, offset: 0x6EE9F, size: 0x8, addend: 0x0, symName: '-[MTBBarcodeScanner .cxx_destruct]', symObjAddr: 0x339C, symBinAddr: 0xB39C, symSize: 0xD4 }
...

View File

@ -0,0 +1,17 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "MTBBarcodeScanner.h"
FOUNDATION_EXPORT double MTBBarcodeScannerVersionNumber;
FOUNDATION_EXPORT const unsigned char MTBBarcodeScannerVersionString[];

View File

@ -0,0 +1,330 @@
//
// MTBBarcodeScanner.h
// MTBBarcodeScannerExample
//
// Created by Mike Buss on 2/8/14.
//
//
#import <AVFoundation/AVFoundation.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, MTBCamera) {
MTBCameraBack,
MTBCameraFront
};
/**
* Available torch modes when scanning barcodes.
*
* While AVFoundation provides an additional automatic
* mode, it is not supported here because it only works
* with video recordings, not barcode scanning.
*/
typedef NS_ENUM(NSUInteger, MTBTorchMode) {
MTBTorchModeOff,
MTBTorchModeOn,
};
@interface MTBBarcodeScanner : NSObject
/**
* The currently set camera. See MTBCamera for options.
*
* @sa setCamera:error:
*/
@property (nonatomic, assign, readonly) MTBCamera camera;
/**
* Control the torch on the device, if present.
*
* Attempting to set the torch mode to an unsupported state
* will fail silently, and the value passed into the setter
* will be discarded.
*
* @sa setTorchMode:error:
*/
@property (nonatomic, assign) MTBTorchMode torchMode;
/**
* Allow the user to tap the previewView to focus a specific area.
* Defaults to YES.
*/
@property (nonatomic, assign) BOOL allowTapToFocus;
/**
* If set, only barcodes inside this area will be scanned.
*
* Setting this property is only supported while the scanner is active.
* Use the didStartScanningBlock if you want to set it as early as
* possible.
*/
@property (nonatomic, assign) CGRect scanRect;
/**
* Layer used to present the camera input. If the previewView
* does not use auto layout, it may be necessary to adjust the layers frame.
*/
@property (nonatomic, strong) CALayer *previewLayer;
/*!
@property didStartScanningBlock
@abstract
Optional callback block that's called when the scanner finished initializing.
@discussion
Optional callback that will be called when the scanner is initialized and the view
is presented on the screen. This is useful for presenting an activity indicator
while the scanner is initializing.
The block is always called on the main queue.
*/
@property (nonatomic, copy) void (^didStartScanningBlock)(void);
/*!
@property didTapToFocusBlock
@abstract
Block that's called when the user taps the screen to focus the camera. If allowsTapToFocus
is set to NO, this will never be called.
*/
@property (nonatomic, copy) void (^didTapToFocusBlock)(CGPoint point);
/*!
@property resultBlock
@abstract
Block that's called every time one or more barcodes are recognized.
@discussion
The resultBlock is called on the main queue once for every frame that at least one valid barcode is found.
This block is automatically set when you call startScanningWithResultBlock:
*/
@property (nonatomic, copy) void (^resultBlock)(NSArray<AVMetadataMachineReadableCodeObject *> *codes);
/*!
@property preferredAutoFocusRangeRestriction
@abstract
Auto focus range restriction, if supported.
@discussion
Defaults to AVCaptureAutoFocusRangeRestrictionNear. Will be ignored on unsupported devices.
*/
@property (nonatomic, assign) AVCaptureAutoFocusRangeRestriction preferredAutoFocusRangeRestriction;
/**
* Initialize a scanner that will feed the camera input
* into the given UIView.
*
* @param previewView View that will be overlayed with the live feed from the camera input.
*
* @return An instance of MTBBarcodeScanner
*/
- (instancetype)initWithPreviewView:(UIView *)previewView;
/**
* Initialize a scanner that will feed the camera input
* into the given UIView. Only codes with a type given in
* the metaDataObjectTypes array will be reported to the result
* block when scanning is started using startScanningWithResultBlock:
*
* @see startScanningWithResultBlock:
*
* @param metaDataObjectTypes Array of AVMetadataObjectTypes to scan for. Only codes with types given in this array will be reported to the resultBlock.
* @param previewView View that will be overlayed with the live feed from the camera input.
*
* @return An instance of MTBBarcodeScanner
*/
- (instancetype)initWithMetadataObjectTypes:(NSArray<NSString *> *)metaDataObjectTypes
previewView:(UIView *)previewView;
/**
* Returns whether any camera exists in this device.
* Be aware that this returns NO if camera access is restricted.
*
* @return YES if the device has a camera and authorization state is not AVAuthorizationStatusRestricted
*/
+ (BOOL)cameraIsPresent;
/**
* You can use this flag to check whether flipCamera can potentially
* be successful. You may want to hide your button to flip the camera
* if the device only has one camera.
*
* @return YES if a second camera is present and authorization state is not AVAuthorizationStatusRestricted.
* @sa flipCamera
*/
- (BOOL)hasOppositeCamera;
/**
* Returns whether scanning is prohibited by the user of the device.
*
* @return YES if the user has prohibited access to (or is prohibited from accessing) the camera.
*/
+ (BOOL)scanningIsProhibited;
/**
* Request permission to access the camera on the device.
*
* The success block will return YES if the user granted permission, has granted permission in the past, or if the device is running iOS 7.
* The success block will return NO if the user denied permission, is restricted from the camera, or if there is no camera present.
*/
+ (void)requestCameraPermissionWithSuccess:(void (^)(BOOL success))successBlock;
/**
* Start scanning for barcodes. The camera input will be added as a sublayer
* to the UIView given for previewView during initialization.
*
* This method assumes you have already set the `resultBlock` property directly.
*
* This method returns quickly and does not wait for the internal session to
* start. Set the didStartScanningBlock to get a callback when the session
* is ready, i.e., a camera picture is visible.
*
* @param error Error supplied if the scanning could not start.
*
* @return YES if scanning started successfully, NO if there was an error.
*/
- (BOOL)startScanningWithError:(NSError **)error;
/**
* Start scanning for barcodes. The camera input will be added as a sublayer
* to the UIView given for previewView during initialization.
*
* This method returns quickly and does not wait for the internal session to
* start. Set the didStartScanningBlock to get a callback when the session
* is ready, i.e., a camera picture is visible.
*
* @param resultBlock Callback block for captured codes. If the scanner was instantiated with initWithMetadataObjectTypes:previewView, only codes with a type given in metaDataObjectTypes will be reported.
* @param error Error supplied if the scanning could not start.
*
* @return YES if scanning started successfully, NO if there was an error.
*/
- (BOOL)startScanningWithResultBlock:(void (^)(NSArray<AVMetadataMachineReadableCodeObject *> *codes))resultBlock error:(NSError **)error;
/**
* Start scanning for barcodes using a specific camera. The camera input will be added as a sublayer
* to the UIView given for previewView during initialization.
*
* This method returns quickly and does not wait for the internal session to
* start. Set the didStartScanningBlock to get a callback when the session
* is ready, i.e., a camera picture is visible.
*
* @param camera The camera to use when scanning starts.
* @param resultBlock Callback block for captured codes. If the scanner was instantiated with initWithMetadataObjectTypes:previewView, only codes with a type given in metaDataObjectTypes will be reported.
* @param error Error supplied if the scanning could not start.
*
*
* @return YES if scanning started successfully, NO if there was an error.
*/
- (BOOL)startScanningWithCamera:(MTBCamera)camera resultBlock:(void (^)(NSArray<AVMetadataMachineReadableCodeObject *> *codes))resultBlock error:(NSError **)error;
/**
* Stop scanning for barcodes. The live feed from the camera will be removed as a sublayer from the previewView given during initialization.
*/
- (void)stopScanning;
/**
* Whether the scanner is currently scanning for barcodes
*
* @return YES if the scanner is currently scanning for barcodes
*/
- (BOOL)isScanning;
/**
* If using the front camera, switch to the back, or visa-versa.
* If this method is called when isScanning=NO, it has no effect
*
* If the opposite camera is not available, this method will do nothing.
*
* @sa hasOppositeCamera
*/
- (void)flipCamera;
/**
* Sets the camera and ignores any errors.
*
* Deprecated.
*
* @sa setCamera:error:
*/
- (void)setCamera:(MTBCamera)camera NS_DEPRECATED_IOS(2.0, 2.0, "Use setCamera:error: instead");
/**
* Sets the camera. This operation may fail, e.g., when the device
* does not have the specified camera.
*
* @param camera The camera to use, see MTBCamera for options.
* @error Any error that occurred while trying to set the camera.
* @return YES, if the specified camera was set successfully, NO if any error occurred.
*/
- (BOOL)setCamera:(MTBCamera)camera error:(NSError **)error;
/**
* If using the front camera, switch to the back, or visa-versa.
*
* If this method is called when (isScanning == NO), it will return
* NO and provide an error.
*
* If the opposite camera is not available, the error parameter
* will explain the error.
*
* @return YES if the camera was flipped, NO if any error occurred.
*/
- (BOOL)flipCameraWithError:(NSError **)error;
/**
* Return a BOOL value that specifies whether the current capture device has a torch.
*
* @return YES if the the current capture device has a torch.
*/
- (BOOL)hasTorch;
/**
* Toggle the torch from on to off, or off to on.
* If the device does not support a torch or the opposite mode, calling
* this method will have no effect.
* To set the torch to on/off directly, set the `torchMode` property, or
* use setTorchMode:error: if you care about errors.
*/
- (void)toggleTorch;
/**
* Attempts to set a new torch mode.
*
* @return YES, if setting the new mode was successful, and the torchMode
* property reflects the new state. NO if there was an error - use the
* error parameter to learn about the reason.
*
* @sa torchMode
*/
- (BOOL)setTorchMode:(MTBTorchMode)torchMode error:(NSError **)error;
/**
* Freeze capture keeping the last frame on previewView.
* If this method is called before startScanning, it has no effect.
*
* Returns immediately actually freezing the capture is
* done asynchronously.
*/
- (void)freezeCapture;
/**
* Unfreeze a frozen capture.
*
* Returns immediately actually unfreezing the capture is
* done asynchronously.
*/
- (void)unfreezeCapture;
/**
* Captures a still image of the current camera feed
*/
- (void)captureStillImage:(void (^)(UIImage *image, NSError *error))captureBlock;
/**
* Determine if currently capturing a still image
*/
- (BOOL)isCapturingStillImage;
@end

View File

@ -0,0 +1,6 @@
framework module MTBBarcodeScanner {
umbrella header "MTBBarcodeScanner-umbrella.h"
export *
module * { export * }
}

View File

@ -0,0 +1,147 @@
<?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>files</key>
<dict>
<key>Headers/MTBBarcodeScanner-umbrella.h</key>
<data>
bYsiuTWtV0Q3FZuz1I7/rbLrvHw=
</data>
<key>Headers/MTBBarcodeScanner.h</key>
<data>
NObz/budpFE9ibxE3ktkr9bY4fc=
</data>
<key>Info.plist</key>
<data>
RTSjR0y/LP7UZJt1KHMMYssp1gY=
</data>
<key>Modules/module.modulemap</key>
<data>
tja/Hc15QeCfbSeoH4fcDs45Ayc=
</data>
</dict>
<key>files2</key>
<dict>
<key>Headers/MTBBarcodeScanner-umbrella.h</key>
<dict>
<key>hash</key>
<data>
bYsiuTWtV0Q3FZuz1I7/rbLrvHw=
</data>
<key>hash2</key>
<data>
63IWY53x5NNZ1fewowdhbn9OC4Mdfp3Z+TLQlRKFGtY=
</data>
</dict>
<key>Headers/MTBBarcodeScanner.h</key>
<dict>
<key>hash</key>
<data>
NObz/budpFE9ibxE3ktkr9bY4fc=
</data>
<key>hash2</key>
<data>
UljKwrrsoCA7UBkvkg4X0yHR4x623PBm4x5K5I9eTDo=
</data>
</dict>
<key>Modules/module.modulemap</key>
<dict>
<key>hash</key>
<data>
tja/Hc15QeCfbSeoH4fcDs45Ayc=
</data>
<key>hash2</key>
<data>
eSAYBLwJ41uW+rEqvktKy2zo2FvDdmYf6ByC+i+70XE=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>