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() } }