ChooseApartmentsViewController.swift
1.78 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
//
// ChooseApartmentsViewController.swift
// InterQR-Internship
//
// Created by Дмитрий Тимофеев on 14.06.2022.
//
import UIKit
class ChooseApartmentsViewController: UIViewController {
var mainView = ChooseApartmentView()
override func loadView() {
view = mainView
}
override func viewDidLoad() {
super.viewDidLoad()
initViewController()
}
func initViewController() {
mainView.backButton.addTarget(self, action: #selector(backToSettingsVC), for: .touchUpInside)
mainView.tableView.delegate = self
mainView.tableView.dataSource = self
mainView.tableView.register(ChooseApartmentsTableViewCell.self, forCellReuseIdentifier: ChooseApartmentsTableViewCell.id)
}
@objc func backToSettingsVC() {
navigationController?.popViewController(animated: true)
}
}
extension ChooseApartmentsViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
3
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: ChooseApartmentsTableViewCell.id, for: indexPath) as? ChooseApartmentsTableViewCell else { return UITableViewCell() }
// cell.configureWithItem(doors[indexPath.row])
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
87
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = ResidentsViewController()
navigationController?.pushViewController(vc, animated: true)
print("❌")
}
}