-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathLaunchCheck.swift
46 lines (42 loc) · 1.74 KB
/
LaunchCheck.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// LaunchCheck.swift
// Democracy
//
// Created by Liam Dowd on 8/30/22.
//
import UIKit
class LaunchCheck: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
print("Made it to launch check")
UserDefaults.standard.set(0, forKey: "index")
var loggedIn = UserDefaults.standard.string(forKey: "loggedIn")
switch loggedIn {
case "true":
DispatchQueue.main.async {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
//let vc = storyboard.instantiateViewController(withIdentifier: "HomeScreen")
let vc = storyboard.instantiateViewController(withIdentifier: "HomeScreen")
self.present(vc, animated: true)
}
case "false" :
DispatchQueue.main.async {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "PromotionScreen")
self.present(vc, animated: true)
}
case nil:
DispatchQueue.main.async {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "PromotionScreen")
self.present(vc, animated: true)
}
default:
DispatchQueue.main.async {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "PromotionScreen")
self.present(vc, animated: true)
}
}
}
}