@@ -54,6 +54,13 @@ final class EditScanViewController: UIViewController, UIAdaptivePresentationCont
5454 button. tintColor = . white
5555 return button
5656 } ( )
57+
58+ lazy private var cancelButton : UIBarButtonItem = {
59+ let title = NSLocalizedString ( " mbdoccapture.cancel_button " , tableName: nil , bundle: bundle ( ) , value: " Cancel " , comment: " " )
60+ let button = UIBarButtonItem ( title: title, style: . plain, target: self , action: #selector( dismissEditScanViewControllerController) )
61+ button. tintColor = . white
62+ return button
63+ } ( )
5764
5865 /// The image the rectangle was detected on.
5966 private let image : UIImage
@@ -85,7 +92,8 @@ final class EditScanViewController: UIViewController, UIAdaptivePresentationCont
8592 setupConstraints ( )
8693 title = NSLocalizedString ( " mbdoccapture.scan_edit_title " , tableName: nil , bundle: bundle ( ) , value: " Trimming " , comment: " " )
8794 navigationItem. rightBarButtonItem = nextButton
88-
95+ navigationItem. leftBarButtonItem = cancelButton
96+
8997 if #available( iOS 13 . 0 , * ) {
9098 isModalInPresentation = false
9199 navigationController? . presentationController? . delegate = self
@@ -146,6 +154,9 @@ final class EditScanViewController: UIViewController, UIAdaptivePresentationCont
146154
147155 // MARK: - Actions
148156
157+ @objc func dismissEditScanViewControllerController( ) {
158+ dismiss ( animated: true )
159+ }
149160 @objc func pushReviewController( ) {
150161 guard let rect = rectView. rect,
151162 let ciImage = CIImage ( image: image) else {
0 commit comments