Skip to content

Commit

Permalink
Optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
tbehera committed Aug 10, 2018
1 parent ca196e8 commit 99a5590
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion SampleApp/DocumentCameraController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import AcuantMobileSDK
class DocumentCameraController : UIViewController,DocumentCaptureDelegate{
private let context = CIContext()

var captureWaitTime = 2

let vcUtil = ViewControllerUtils()

var captureSession: DocumentCaptureSession!
Expand Down Expand Up @@ -105,7 +107,7 @@ class DocumentCameraController : UIViewController,DocumentCaptureDelegate{

@objc func screenTapped(_ sender:UITapGestureRecognizer){
messageLayer.string = "HOLD STEADY"
captureSession.startCapturing(timeout: 1)
captureSession.startCapturing(timeout: captureWaitTime)
}

func startCameraView() {
Expand Down
2 changes: 1 addition & 1 deletion SampleApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>5</string>
<string>6</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
Expand Down
15 changes: 12 additions & 3 deletions SampleApp/RootViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class RootViewController: UIViewController , InitializationDelegate , IDProcessi
public var capturedFaceImageUrl : String? = nil
public var isHealthCard : Bool = false
var side = 0 // 0 : Front 1: Back
var captureWaitTime = 0

@IBOutlet var medicalCardButton: UIButton!
@IBOutlet var idPassportButton: UIButton!
Expand All @@ -40,11 +41,14 @@ class RootViewController: UIViewController , InitializationDelegate , IDProcessi
}

func showDocumentCaptureCamera(){
AppDelegate.navigationController?.pushViewController(DocumentCameraController(), animated: false)
let documentCameraController = DocumentCameraController()
documentCameraController.captureWaitTime = captureWaitTime
AppDelegate.navigationController?.pushViewController(documentCameraController, animated: false)
}

func resetData(){
side = 0
captureWaitTime = 0
isProcessing = false
isLiveFace = false
isHealthCard = false
Expand Down Expand Up @@ -216,6 +220,11 @@ class RootViewController: UIViewController , InitializationDelegate , IDProcessi
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default)
{ action -> Void in
self.side = 1
if(self.isHealthCard){
self.captureWaitTime = 0
}else{
self.captureWaitTime = 1
}
self.showDocumentCaptureCamera()
})
self.present(alert, animated: true, completion: nil)
Expand Down Expand Up @@ -251,8 +260,8 @@ class RootViewController: UIViewController , InitializationDelegate , IDProcessi
endPoints.healthInsuranceEndpoint = "https://medicscan.acuant.net/api/v1"

credential.endpoints = endPoints
credential.username = "xxxxxx@acuantcorp.com"
credential.password = "xxxxxxxx"
credential.username = "xxxxxxx@xxxxxx.com"
credential.password = "xxxxxxxxxx"
credential.subscription = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
vcUtil.showActivityIndicator(uiView: self.view, text: "Initializing...")
Controller.initialize(credential: credential, delegate:self)
Expand Down

0 comments on commit 99a5590

Please sign in to comment.