|
|
@ -51,49 +51,17 @@ class _SplashScreenViewController: UIViewController { |
|
|
|
} |
|
|
|
override func viewDidLoad() { |
|
|
|
super.viewDidLoad() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
func redirectToApp(){ |
|
|
|
if (UserDefaults.standard.object(forKey: "com.gmeremit.loginStatus") as! Bool){ |
|
|
|
guard (UserDefaults.standard.object(forKey: "com.gmeremit.isKYCSubmitted") as! Bool) else { |
|
|
|
let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main) |
|
|
|
if let KYCPersonalInfoViewController = storyboard.instantiateViewController(withIdentifier: "KYCPersonalInfoViewController") as? KYCPersonalInfoViewController { |
|
|
|
|
|
|
|
self.navigationController!.pushViewController(KYCPersonalInfoViewController, animated: true) |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
// self.performSegue(withIdentifier: "autoLogin", sender: nil) |
|
|
|
let mainWireFram = MainWireframe.shared |
|
|
|
let window = UIApplication.shared.keyWindow |
|
|
|
window?.rootViewController = mainWireFram?.getMainView() |
|
|
|
window?.makeKeyAndVisible() |
|
|
|
} else { |
|
|
|
let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main) |
|
|
|
if let loginViewController = storyboard.instantiateViewController(withIdentifier: "loginViewController") as? LoginViewController { |
|
|
|
|
|
|
|
self.navigationController!.pushViewController(loginViewController, animated: true) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@objc func handleSwipes(_ sender: UISwipeGestureRecognizer) { |
|
|
|
if (sender.direction == .right) { |
|
|
@ -122,23 +90,18 @@ class _SplashScreenViewController: UIViewController { |
|
|
|
|
|
|
|
func setImageandLabels() { |
|
|
|
|
|
|
|
// imageViewDotLeft.image = imageDotUnselected |
|
|
|
// imageViewDotCenter.image = imageDotUnselected |
|
|
|
// imageViewDotRight.image = imageDotUnselected |
|
|
|
|
|
|
|
switch counter { |
|
|
|
case 0: |
|
|
|
// imageViewDotLeft.image = imageDotSelected |
|
|
|
imageViewHomeLogo.image = imageFirst |
|
|
|
labelHomeDescription.text = descriptionFirst |
|
|
|
labelHomeDescription.text = "hassle_free_transfer_text".localized() |
|
|
|
case 1: |
|
|
|
// imageViewDotCenter.image = imageDotSelected |
|
|
|
imageViewHomeLogo.image = imageSecond |
|
|
|
labelHomeDescription.text = descriptionSecond |
|
|
|
labelHomeDescription.text = "connect_local_community_text".localized() |
|
|
|
case 2: |
|
|
|
// imageViewDotRight.image = imageDotSelected |
|
|
|
imageViewHomeLogo.image = imageThird |
|
|
|
labelHomeDescription.text = descriptionThird |
|
|
|
labelHomeDescription.text = "earn_reward_point_text".localized() |
|
|
|
default: |
|
|
|
return |
|
|
|
} |
|
|
|