Browse Source

loop fixed. splash login and register

pull/1/head
gme_2 6 years ago
parent
commit
ef958be63a
  1. 1
      GMERemittance/Extension/UIViewControllerExtension.swift
  2. 1
      GMERemittance/Module/Login/User Interface/View/LoginViewController.swift
  3. 10
      GMERemittance/Module/Register/User Interface/View/RegisterViewController.swift
  4. 15
      GMERemittance/Module/Register/User Interface/Wireframe/RegisterWireframe.swift
  5. 5
      GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframe.swift

1
GMERemittance/Extension/UIViewControllerExtension.swift

@ -15,6 +15,7 @@ import MBProgressHUD
extension UIViewController { extension UIViewController {
func setupPicturedNavBar(sideMenuAction: Selector? = nil) { func setupPicturedNavBar(sideMenuAction: Selector? = nil) {
self.navigationController?.isNavigationBarHidden = false
self.navigationController?.navigationBar.isTranslucent = false self.navigationController?.navigationBar.isTranslucent = false
if let selector = sideMenuAction { if let selector = sideMenuAction {
let leftButton = UIBarButtonItem(image: UIImage(named: "ic_hamburger"), style: .plain, target: self, action: selector) let leftButton = UIBarButtonItem(image: UIImage(named: "ic_hamburger"), style: .plain, target: self, action: selector)

1
GMERemittance/Module/Login/User Interface/View/LoginViewController.swift

@ -54,7 +54,6 @@ class LoginViewController: UIViewController {
} }
private func setupNavBar() { private func setupNavBar() {
self.navigationController?.isNavigationBarHidden = false
self.setupPicturedNavBar() self.setupPicturedNavBar()
} }
} }

10
GMERemittance/Module/Register/User Interface/View/RegisterViewController.swift

@ -29,6 +29,16 @@ class RegisterViewController: UIViewController {
self.setup() 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 // MARK: IBActions
@IBAction func login(_ sender: UIButton) { @IBAction func login(_ sender: UIButton) {

15
GMERemittance/Module/Register/User Interface/Wireframe/RegisterWireframe.swift

@ -10,6 +10,8 @@ import UIKit
class RegisterWireframe { class RegisterWireframe {
weak var view: UIViewController! weak var view: UIViewController!
var isFromSplash: Bool = false
lazy var loginWireFrame = LoginWireframe()
} }
extension RegisterWireframe: RegisterWireframeInput { extension RegisterWireframe: RegisterWireframeInput {
@ -33,6 +35,17 @@ extension RegisterWireframe: RegisterWireframeInput {
} }
func login() { 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)
} }
} }

5
GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframe.swift

@ -11,6 +11,7 @@ import UIKit
class SplashScreenWireframe { class SplashScreenWireframe {
weak var view: UIViewController! weak var view: UIViewController!
lazy var loginWireframe = LoginWireframe() lazy var loginWireframe = LoginWireframe()
lazy var registerWireFrame = RegisterWireframe()
} }
extension SplashScreenWireframe: SplashScreenWireframeInput { extension SplashScreenWireframe: SplashScreenWireframeInput {
@ -40,7 +41,9 @@ extension SplashScreenWireframe: SplashScreenWireframeInput {
} }
func register() { func register() {
if let navigation = self.view.navigationController {
registerWireFrame.openRegistrationFromSplash(source: navigation)
}
} }
} }
Loading…
Cancel
Save