Signed-off-by: Marino Faggiana <8616947+marinofaggiana@users.noreply.github.com>
@@ -885,7 +885,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
case NCGlobal.shared.actionScanDocument:
- NCDocumentCamera().openScannerDocument(viewController: rootViewController)
+ NCDocumentCamera.shared.openScannerDocument(viewController: rootViewController)
case NCGlobal.shared.actionTextDocument:
@@ -84,7 +84,7 @@ extension AppDelegate {
NCMenuAction(
title: NSLocalizedString("_scans_document_", comment: ""), icon: NCUtility().loadImage(named: "doc.text.viewfinder"), action: { _ in
if let viewController = appDelegate.window?.rootViewController {
- NCDocumentCamera().openScannerDocument(viewController: viewController)
+ NCDocumentCamera.shared.openScannerDocument(viewController: viewController)
}
)
@@ -25,6 +25,10 @@ import Foundation
import VisionKit
class NCDocumentCamera: NSObject, VNDocumentCameraViewControllerDelegate {
+ static let shared: NCDocumentCamera = {
+ let instance = NCDocumentCamera()
+ return instance
+ }()
var viewController: UIViewController?
let utilityFileSystem = NCUtilityFileSystem()
@@ -185,7 +185,7 @@ class NCScan: UIViewController, NCScanCellCellDelegate {
// TIP
dismissTip()
- NCDocumentCamera().openScannerDocument(viewController: self)
+ NCDocumentCamera.shared.openScannerDocument(viewController: self)
@IBAction func transferDown(sender: UIButton) {