diff --git a/MiniScanner/Modules/EditViewController/EditViewController.swift b/MiniScanner/Modules/EditViewController/EditViewController.swift index c7eb9a15a18eb01bdd6a33099722bfbc1b3e8feb..3305515af9decb8b5b528448322d065d48106d53 100644 --- a/MiniScanner/Modules/EditViewController/EditViewController.swift +++ b/MiniScanner/Modules/EditViewController/EditViewController.swift @@ -119,6 +119,32 @@ public class EditViewController: UIViewController, ScanSessionSharable, ScanSess public override func viewDidLoad() { super.viewDidLoad() + setupUI() + } + + public override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + + deviceOrientationHelper.startDeviceOrientationNotifier { [weak self] (deviceOrientation) in + guard let self else { return } + + print("orientation: \(deviceOrientation)") + orientationChanged(deviceOrientation: deviceOrientation) + } + } + + init(scanSession: ScanSession) { + self.scanSession = scanSession + super.init(nibName: nil, bundle: nil) + } + + required init?(coder aDecoder: NSCoder) { + scanSession = .newSession() + fatalError("init(coder:) should not be called for this class") + } + + private func setupUI() { + setupColors() banner.set(session: scanSession) @@ -197,27 +223,6 @@ public class EditViewController: UIViewController, ScanSessionSharable, ScanSess saveCropButton.customTitleColor(.gray0) } - public override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - - deviceOrientationHelper.startDeviceOrientationNotifier { [weak self] (deviceOrientation) in - guard let self else { return } - - print("orientation: \(deviceOrientation)") - orientationChanged(deviceOrientation: deviceOrientation) - } - } - - init(scanSession: ScanSession) { - self.scanSession = scanSession - super.init(nibName: nil, bundle: nil) - } - - required init?(coder aDecoder: NSCoder) { - scanSession = .newSession() - fatalError("init(coder:) should not be called for this class") - } - // MARK: - Methods @objc func backTapped() { if navigationItem.rightBarButtonItem == nil {