Skip to content

Commit

Permalink
Merge pull request #4 from caspahouzer/master
Browse files Browse the repository at this point in the history
clear scannerController to avoid show old scans on open
  • Loading branch information
hansemannn authored Jan 16, 2021
2 parents 839d671 + 1c64afb commit df8e228
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
6 changes: 6 additions & 0 deletions Classes/TiScannerModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,16 @@ - (void)documentCameraViewControllerDidCancel:(VNDocumentCameraViewController *)
{
[self fireEvent:@"cancel"];
[controller dismissViewControllerAnimated:YES completion:nil];
_scannerViewController.delegate = nil;
_scannerViewController = nil;
}

- (void)documentCameraViewController:(VNDocumentCameraViewController *)controller didFailWithError:(NSError *)error
{
[self fireEvent:@"error" withObject:@{ @"error": error.localizedDescription }];
[controller dismissViewControllerAnimated:YES completion:nil];
_scannerViewController.delegate = nil;
_scannerViewController = nil;
}

- (void)documentCameraViewController:(VNDocumentCameraViewController *)controller didFinishWithScan:(VNDocumentCameraScan *)scan
Expand All @@ -83,6 +87,8 @@ - (void)documentCameraViewController:(VNDocumentCameraViewController *)controlle

[self fireEvent:@"success" withObject:@{ @"count": @(scan.pageCount), @"title": NULL_IF_NIL(scan.title) }];
[controller dismissViewControllerAnimated:YES completion:nil];
_scannerViewController.delegate = nil;
_scannerViewController = nil;
}

@end
7 changes: 4 additions & 3 deletions manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 1.0.0
version: 2.0.0
apiversion: 2
architectures: armv7 arm64 i386 x86_64
architectures: arm64 x86_64
description: titanium-scanner
author: Hans Knöchel
license: MIT
Expand All @@ -15,4 +15,5 @@ name: titanium-scanner
moduleid: ti.scanner
guid: 558d8ef6-a01d-4474-ac25-777fdecf86a8
platform: iphone
minsdk: 8.2.0
mac: false
minsdk: 9.2.0
11 changes: 8 additions & 3 deletions titanium-scanner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand All @@ -234,8 +235,9 @@
GCC_WARN_UNUSED_VALUE = NO;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LIBRARY_SEARCH_PATHS = "";
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = (
"-DDEBUG",
"-DTI_POST_1_2",
Expand All @@ -255,6 +257,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
DEPLOYMENT_POSTPROCESSING = YES;
Expand All @@ -278,8 +281,9 @@
GCC_WARN_UNUSED_VALUE = NO;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LIBRARY_SEARCH_PATHS = "";
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = "-DTI_POST_1_2";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = ti.scanner;
Expand Down Expand Up @@ -341,6 +345,7 @@
GCC_WARN_UNUSED_VALUE = NO;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-DDEBUG",
Expand Down Expand Up @@ -405,7 +410,7 @@
GCC_WARN_UNUSED_VALUE = NO;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
OTHER_CFLAGS = "-DTI_POST_1_2";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = ti.scanner;
Expand Down
6 changes: 3 additions & 3 deletions titanium.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
// OF YOUR TITANIUM SDK YOU'RE BUILDING FOR
//
//
TITANIUM_SDK_VERSION = 8.2.0
TITANIUM_SDK_VERSION = 9.3.0.GA

//
// THESE SHOULD BE OK GENERALLY AS-IS
//
TITANIUM_SDK = ~/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION)
TITANIUM_SDK = /Users/$(USER)/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION)
HEADER_SEARCH_PATHS = $(inherited) "$(TITANIUM_SDK)/iphone/include"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$(TITANIUM_SDK)/iphone/Frameworks"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$(TITANIUM_SDK)/iphone/Frameworks/**"

0 comments on commit df8e228

Please sign in to comment.