-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathSignUpViewController.swift
More file actions
55 lines (43 loc) · 1.53 KB
/
SignUpViewController.swift
File metadata and controls
55 lines (43 loc) · 1.53 KB
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
//
// SignUpViewController.swift
// RoutingExample
//
// Created by Cassius Pacheco on 7/3/20.
// Copyright © 2020 Cassius Pacheco. All rights reserved.
//
import UIKit
final class SignUpViewController: UIViewController {
private let viewModel: SignUpViewModelInterface
init(viewModel: SignUpViewModelInterface) {
self.viewModel = viewModel
super.init(nibName: nil, bundle: nil)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
print("👶 \(self) Created")
let dismissButton = DefaultButton(title: "Dismiss", target: self, selector: #selector(dismissButtonTouchUpInside))
let forgottenPasswordButton = DefaultButton(title: "Forgot Password", target: self, selector: #selector(forgottenPasswordButtonTouchUpInside))
let vStack = UIStackView(arrangedSubviews: [dismissButton, forgottenPasswordButton])
vStack.axis = .vertical
vStack.spacing = 8.0
view.addSubview(vStack)
vStack.layout.center(in: view)
}
@objc
private func forgottenPasswordButtonTouchUpInside() {
print("Forgotten Password Button pressed")
viewModel.forgottenPasswordButtonTouchUpInside()
}
@objc
private func dismissButtonTouchUpInside() {
print("Dismiss Button pressed")
viewModel.dismissButtonTouchUpInside()
}
deinit {
print("♻️ \(self) Deallocated")
}
}