Show scanner

After initialization is completed and the scenario is set, you can start document scanning process:

Swift
Objective-C
Swift
DocReader.shared.showScanner(self) { (action, result, error) in
switch action {
case .cancel:
print("Cancelled by user")
case .complete:
print("Completed")
guard let result = result else { return }
print("Result class: \(result)")
case .error:
print("Error: \(error)")
case .process:
guard let result = result else { return }
print("Scanning is not finished. Result: \(result)")
}
}
Objective-C
[RGLDocReader.shared showScanner:self completion:^(enum RGLDocReaderAction action, RGLDocumentReaderResults * _Nullable result, NSError * _Nullable error) {
switch (action) {
case RGLDocReaderActionCancel: {
NSLog(@"Cancelled by user");
}
break;
case RGLDocReaderActionComplete: {
NSLog(@"Completed");
NSLog(@"Result class: %@", result);
}
break;
case RGLDocReaderActionError: {
NSLog(@"Error string: %@", error);
}
break;
case RGLDocReaderActionProcess: {
NSLog(@"Scanning is not finished. Result: %@", result);
}
break;
default:
break;
}
}];