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. 13
      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 {
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)

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

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

10
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) {

13
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() {
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 {
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)
}
}
}
Loading…
Cancel
Save