Newer
Older
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
47
48
49
50
51
52
53
54
55
56
57
58
import HUD
import UIKit
import Theme
import Shared
import Combine
import DependencyInjection
final class OnboardingStartController: UIViewController {
@Dependency private var hud: HUDType
@Dependency private var coordinator: OnboardingCoordinating
lazy private var screenView = OnboardingStartView()
private let ndf: String
private var cancellables = Set<AnyCancellable>()
override func loadView() {
view = screenView
}
init(_ ndf: String) {
self.ndf = ndf
super.init(nibName: nil, bundle: nil)
}
required init?(coder: NSCoder) { nil }
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.navigationBar.customize(translucent: true)
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
let gradient = CAGradientLayer()
gradient.colors = [
UIColor(red: 122/255, green: 235/255, blue: 239/255, alpha: 1).cgColor,
UIColor(red: 56/255, green: 204/255, blue: 232/255, alpha: 1).cgColor,
UIColor(red: 63/255, green: 186/255, blue: 253/255, alpha: 1).cgColor,
UIColor(red: 98/255, green: 163/255, blue: 255/255, alpha: 1).cgColor
]
gradient.startPoint = CGPoint(x: 0, y: 0)
gradient.endPoint = CGPoint(x: 1, y: 1)
gradient.frame = screenView.bounds
screenView.layer.insertSublayer(gradient, at: 0)
}
override func viewDidLoad() {
super.viewDidLoad()
screenView.startButton.publisher(for: .touchUpInside)
.sink { [unowned self] in coordinator.toUsername(with: ndf, from: self) }
.store(in: &cancellables)
}
}