diff --git a/GMERemittance/Extension/UIViewControllerExtension.swift b/GMERemittance/Extension/UIViewControllerExtension.swift index f044bfaf..e59ae24d 100644 --- a/GMERemittance/Extension/UIViewControllerExtension.swift +++ b/GMERemittance/Extension/UIViewControllerExtension.swift @@ -15,6 +15,7 @@ import MBProgressHUD extension UIViewController { func setupPicturedNavBar(sideMenuAction: Selector? = nil) { + self.navigationController?.isNavigationBarHidden = false self.navigationController?.navigationBar.isTranslucent = false if let selector = sideMenuAction { let leftButton = UIBarButtonItem(image: UIImage(named: "ic_hamburger"), style: .plain, target: self, action: selector) diff --git a/GMERemittance/Module/Login/User Interface/View/LoginViewController.swift b/GMERemittance/Module/Login/User Interface/View/LoginViewController.swift index 884e9334..f9cfef89 100644 --- a/GMERemittance/Module/Login/User Interface/View/LoginViewController.swift +++ b/GMERemittance/Module/Login/User Interface/View/LoginViewController.swift @@ -54,7 +54,6 @@ class LoginViewController: UIViewController { } private func setupNavBar() { - self.navigationController?.isNavigationBarHidden = false self.setupPicturedNavBar() } } diff --git a/GMERemittance/Module/Register/User Interface/View/RegisterViewController.swift b/GMERemittance/Module/Register/User Interface/View/RegisterViewController.swift index c51af1d0..be9d096e 100644 --- a/GMERemittance/Module/Register/User Interface/View/RegisterViewController.swift +++ b/GMERemittance/Module/Register/User Interface/View/RegisterViewController.swift @@ -29,6 +29,16 @@ class RegisterViewController: UIViewController { self.setup() } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + self.setupPicturedNavBar() + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + self.navigationItem.title = "" + } + // MARK: IBActions @IBAction func login(_ sender: UIButton) { diff --git a/GMERemittance/Module/Register/User Interface/Wireframe/RegisterWireframe.swift b/GMERemittance/Module/Register/User Interface/Wireframe/RegisterWireframe.swift index 952e855f..15054ee0 100644 --- a/GMERemittance/Module/Register/User Interface/Wireframe/RegisterWireframe.swift +++ b/GMERemittance/Module/Register/User Interface/Wireframe/RegisterWireframe.swift @@ -10,6 +10,8 @@ import UIKit class RegisterWireframe { weak var view: UIViewController! + var isFromSplash: Bool = false + lazy var loginWireFrame = LoginWireframe() } extension RegisterWireframe: RegisterWireframeInput { @@ -33,6 +35,17 @@ extension RegisterWireframe: RegisterWireframeInput { } func login() { - self.view.navigationController?.popViewController(animated: true) + if isFromSplash { + if let navigation = self.view.navigationController { + loginWireFrame.pushMainView(in: navigation) + } + }else { + self.view.navigationController?.popViewController(animated: true) + } + } + + func openRegistrationFromSplash(source: UINavigationController) { + self.isFromSplash = true + self.pushMainView(in: source) } } diff --git a/GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframe.swift b/GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframe.swift index c4dd4f54..f4904390 100644 --- a/GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframe.swift +++ b/GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframe.swift @@ -11,6 +11,7 @@ import UIKit class SplashScreenWireframe { weak var view: UIViewController! lazy var loginWireframe = LoginWireframe() + lazy var registerWireFrame = RegisterWireframe() } extension SplashScreenWireframe: SplashScreenWireframeInput { @@ -40,7 +41,9 @@ extension SplashScreenWireframe: SplashScreenWireframeInput { } func register() { - + if let navigation = self.view.navigationController { + registerWireFrame.openRegistrationFromSplash(source: navigation) + } } }