diff --git a/2q b/2q new file mode 100644 index 00000000..0946894c --- /dev/null +++ b/2q @@ -0,0 +1,384 @@ +splash screen recreated in module + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# Date: Mon Sep 10 14:03:30 2018 +0900 +# Committer: gme_2 +# +# On branch login-revamp +# Changes to be committed: +# modified: GMERemittance/AppDelegate.swift +# modified: GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard +# modified: GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift +# +# ------------------------ >8 ------------------------ +# Do not modify or remove the line above. +# Everything below it will be ignored. +diff --git a/GMERemittance/AppDelegate.swift b/GMERemittance/AppDelegate.swift +index 04a941a..e9fd1c5 100644 +--- a/GMERemittance/AppDelegate.swift ++++ b/GMERemittance/AppDelegate.swift +@@ -74,8 +74,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD + self.window?.rootViewController = mainWireFrame?.getMainView() + }else { + // go to splashscreen +- let splasScreen = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "_SplashScreenViewController") as! _SplashScreenViewController +- self.window?.rootViewController = splasScreen ++ let splashWireframe = SplashScreenWireframe() ++ self.window?.rootViewController = splashWireframe.getMainView() ++// let splasScreen = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "_SplashScreenViewController") as! _SplashScreenViewController ++// self.window?.rootViewController = splasScreen + } + } + +diff --git a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard +index a6cae57..730ea50 100644 +--- a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard ++++ b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard +@@ -1,31 +1,191 @@ + +- ++ + + + + +- ++ ++ ++ ++ + + ++ ++ ++ SanFranciscoDisplay-Regular ++ ++ ++ SanFranciscoDisplay-Semibold ++ ++ + + + + +- +- +- +- +- +- ++ ++ + +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +- ++ + + ++ ++ ++ ++ ++ ++ + + +diff --git a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift +index a2d7ca2..3500219 100644 +--- a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift ++++ b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift +@@ -11,10 +11,37 @@ import UIKit + class SplashScreenViewController: UIViewController { + + // MARK: IBOutlets ++ @IBOutlet weak var imageViewDotCenter: UIImageView! ++ @IBOutlet weak var imageViewDotLeft: UIImageView! ++ @IBOutlet weak var imageViewDotRight: UIImageView! + ++ @IBOutlet weak var imageViewHomeLogo: UIImageView! ++ @IBOutlet weak var labelHomeDescription: UILabel! ++ ++ @IBOutlet weak var constraintLeft: NSLayoutConstraint! ++ @IBOutlet weak var constraintRight: NSLayoutConstraint! ++ ++ @IBOutlet weak var buttonLogin: UIButton! ++ @IBOutlet weak var buttonSignUp: UIButton! + + // MARK: Properties + ++ ++ var counter: Int = 0 ++ ++ let imageDotSelected = UIImage(named: "dotSelected") ++ let imageDotUnselected = UIImage(named: "dotUnselected") ++ ++ let imageFirst = UIImage(named: "ic_splashFirstScreen") ++ let imageSecond = UIImage(named: "ic_splashSecondScreen") ++ let imageThird = UIImage(named: "ic_splashThirdScreen") ++ ++ let descriptionFirst = "Hassle free money transfer to your loved ones" ++ let descriptionSecond = "Connect to local community" ++ let descriptionThird = "Earn reward points and get surprise gifts" ++ ++ ++ + var presenter: SplashScreenModuleInterface? + + +@@ -27,11 +54,99 @@ class SplashScreenViewController: UIViewController { + + // MARK: IBActions + ++ @IBAction func login(_ sender: UIButton) { ++ print("login") ++ } ++ ++ ++ @IBAction func register(_ sender: UIButton) { ++ print("register") ++ } ++ + // MARK: Other Functions + + private func setup() { + // all setup should be done here +- ++ setUpButtons() ++ ++ imageViewDotLeft.image = UIImage(named: "dotSelected") ++ let leftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(_SplashScreenViewController.handleSwipes(_:))) ++ let rightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(_SplashScreenViewController.handleSwipes(_:))) ++ ++ leftSwipe.direction = .left ++ rightSwipe.direction = .right ++ ++ view.addGestureRecognizer(leftSwipe) ++ view.addGestureRecognizer(rightSwipe) ++ ++ Timer.scheduledTimer(timeInterval: 2, target: self, selector: #selector(_SplashScreenViewController.updateImage), userInfo: nil, repeats: true) ++ } ++ ++ @objc func handleSwipes(_ sender: UISwipeGestureRecognizer) { ++ if (sender.direction == .right) { ++ counter = counter - 1 ++ if counter < 0 { ++ counter = 2 ++ } ++ } ++ ++ if (sender.direction == .left) { ++ counter = counter + 1 ++ if counter > 2 { ++ counter = 0 ++ } ++ } ++ setImageandLabels() ++ } ++ ++ @objc func updateImage() { ++ counter += 1 ++ if counter > 2 { ++ counter = 0 ++ } ++ setImageandLabels() ++ } ++ ++ func setImageandLabels() { ++ ++ imageViewDotLeft.image = imageDotUnselected ++ imageViewDotCenter.image = imageDotUnselected ++ imageViewDotRight.image = imageDotUnselected ++ ++ switch counter { ++ case 0: ++ constraintLeft.constant = 34 ++ constraintRight.constant = 33 ++ imageViewDotLeft.image = imageDotSelected ++ imageViewHomeLogo.image = imageFirst ++ labelHomeDescription.text = descriptionFirst ++ case 1: ++ constraintLeft.constant = 34 ++ constraintRight.constant = 33 ++ imageViewDotCenter.image = imageDotSelected ++ imageViewHomeLogo.image = imageSecond ++ labelHomeDescription.text = descriptionSecond ++ case 2: ++ constraintLeft.constant = 61 ++ constraintRight.constant = 60 ++ imageViewDotRight.image = imageDotSelected ++ imageViewHomeLogo.image = imageThird ++ labelHomeDescription.text = descriptionThird ++ default: ++ return ++ } ++ } ++ ++ func setUpButtons() { ++ buttonSignUp.layer.cornerRadius = 25 ++ buttonLogin.backgroundColor = .clear ++ buttonLogin.layer.cornerRadius = 25 ++ buttonLogin.layer.borderWidth = 1 ++ buttonLogin.layer.borderColor = UIColor.white.cgColor ++ } ++ ++ override func didReceiveMemoryWarning() { ++ super.didReceiveMemoryWarning() + } + } + diff --git a/GMERemittance/AppDelegate.swift b/GMERemittance/AppDelegate.swift index e9fd1c56..51540591 100644 --- a/GMERemittance/AppDelegate.swift +++ b/GMERemittance/AppDelegate.swift @@ -75,9 +75,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD }else { // go to splashscreen let splashWireframe = SplashScreenWireframe() - self.window?.rootViewController = splashWireframe.getMainView() -// let splasScreen = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "_SplashScreenViewController") as! _SplashScreenViewController -// self.window?.rootViewController = splasScreen + let nav = UINavigationController.init(rootViewController: splashWireframe.getMainView()) + self.window?.rootViewController = nav } } diff --git a/GMERemittance/Module/Login/User Interface/View/Login.storyboard b/GMERemittance/Module/Login/User Interface/View/Login.storyboard index c9fedb17..c7d0be41 100644 --- a/GMERemittance/Module/Login/User Interface/View/Login.storyboard +++ b/GMERemittance/Module/Login/User Interface/View/Login.storyboard @@ -24,7 +24,7 @@ - + diff --git a/GMERemittance/Module/SplashScreen/Module Interface/SplashScreenModuleInterface.swift b/GMERemittance/Module/SplashScreen/Module Interface/SplashScreenModuleInterface.swift index 27b36d5b..899cac34 100644 --- a/GMERemittance/Module/SplashScreen/Module Interface/SplashScreenModuleInterface.swift +++ b/GMERemittance/Module/SplashScreen/Module Interface/SplashScreenModuleInterface.swift @@ -7,5 +7,6 @@ // protocol SplashScreenModuleInterface: class { - + func login() + func register() } diff --git a/GMERemittance/Module/SplashScreen/User Interface/Presenter/SplashScreenPresenter.swift b/GMERemittance/Module/SplashScreen/User Interface/Presenter/SplashScreenPresenter.swift index 32beccce..9287e1a6 100644 --- a/GMERemittance/Module/SplashScreen/User Interface/Presenter/SplashScreenPresenter.swift +++ b/GMERemittance/Module/SplashScreen/User Interface/Presenter/SplashScreenPresenter.swift @@ -22,7 +22,13 @@ class SplashScreenPresenter { // MARK: SplashScreen module interface extension SplashScreenPresenter: SplashScreenModuleInterface { - + func login() { + self.wireframe?.login() + } + + func register() { + self.wireframe?.register() + } } // MARK: SplashScreen interactor output interface diff --git a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard index 730ea500..f6803e45 100644 --- a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard +++ b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreen.storyboard @@ -1,5 +1,5 @@ - + @@ -164,6 +164,7 @@ + @@ -178,6 +179,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift index 35002190..52b53b20 100644 --- a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift +++ b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift @@ -55,12 +55,12 @@ class SplashScreenViewController: UIViewController { // MARK: IBActions @IBAction func login(_ sender: UIButton) { - print("login") + self.presenter?.login() } @IBAction func register(_ sender: UIButton) { - print("register") + self.presenter?.register() } // MARK: Other Functions @@ -68,7 +68,7 @@ class SplashScreenViewController: UIViewController { private func setup() { // all setup should be done here setUpButtons() - + self.navigationController?.isNavigationBarHidden = true imageViewDotLeft.image = UIImage(named: "dotSelected") let leftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(_SplashScreenViewController.handleSwipes(_:))) let rightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(_SplashScreenViewController.handleSwipes(_:))) diff --git a/GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframe.swift b/GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframe.swift index 259f49f3..c4dd4f54 100644 --- a/GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframe.swift +++ b/GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframe.swift @@ -10,6 +10,7 @@ import UIKit class SplashScreenWireframe { weak var view: UIViewController! + lazy var loginWireframe = LoginWireframe() } extension SplashScreenWireframe: SplashScreenWireframeInput { @@ -31,4 +32,15 @@ extension SplashScreenWireframe: SplashScreenWireframeInput { self.view = viewController return viewController } + + func login() { + if let navigation = self.view.navigationController { + loginWireframe.pushMainView(in: navigation) + } + } + + func register() { + + } } + diff --git a/GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframeInput.swift b/GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframeInput.swift index c12ba55e..472a5768 100644 --- a/GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframeInput.swift +++ b/GMERemittance/Module/SplashScreen/User Interface/Wireframe/SplashScreenWireframeInput.swift @@ -9,5 +9,6 @@ import Foundation protocol SplashScreenWireframeInput: WireframeInput { - + func login() + func register() }