Commit 9c8501aa66085010a66556b182bfa6d5a52d43be

Authored by Dmitriy Tymofyeyev
1 parent 2ecc3c92

add Residents screen

  1 +{
  2 + "images" : [
  3 + {
  4 + "filename" : "Apartman.png",
  5 + "idiom" : "universal",
  6 + "scale" : "1x"
  7 + },
  8 + {
  9 + "filename" : "Group 33613@2x.png",
  10 + "idiom" : "universal",
  11 + "scale" : "2x"
  12 + },
  13 + {
  14 + "filename" : "Group 33613@3x.png",
  15 + "idiom" : "universal",
  16 + "scale" : "3x"
  17 + }
  18 + ],
  19 + "info" : {
  20 + "author" : "xcode",
  21 + "version" : 1
  22 + }
  23 +}
... ...
  1 +{
  2 + "images" : [
  3 + {
  4 + "filename" : "Mask.png",
  5 + "idiom" : "universal",
  6 + "scale" : "1x"
  7 + },
  8 + {
  9 + "filename" : "Mask Group@2x.png",
  10 + "idiom" : "universal",
  11 + "scale" : "2x"
  12 + },
  13 + {
  14 + "filename" : "Mask Group@3x.png",
  15 + "idiom" : "universal",
  16 + "scale" : "3x"
  17 + }
  18 + ],
  19 + "info" : {
  20 + "author" : "xcode",
  21 + "version" : 1
  22 + }
  23 +}
... ...
  1 +//
  2 +// AddResidentsView.swift
  3 +// InterQR-Internship
  4 +//
  5 +// Created by Дмитрий Тимофеев on 14.06.2022.
  6 +//
  7 +
  8 +import Foundation
... ...
  1 +//
  2 +// AddResidentViewController.swift
  3 +// InterQR-Internship
  4 +//
  5 +// Created by Дмитрий Тимофеев on 14.06.2022.
  6 +//
  7 +
  8 +import UIKit
  9 +
  10 +class AddResidentsViewController: UIViewController {
  11 +
  12 + override func viewDidLoad() {
  13 + view.backgroundColor = .red
  14 + }
  15 +}
... ...
  1 +//
  2 +// ChooseApartmentsTableViewCell.swift
  3 +// InterQR-Internship
  4 +//
  5 +// Created by Дмитрий Тимофеев on 14.06.2022.
  6 +//
  7 +
  8 +import UIKit
  9 +
  10 +class ChooseApartmentsTableViewCell: UITableViewCell {
  11 + static let id = "ChooseApartmentsTableViewCell-ID"
  12 +
  13 + var apartmanImage: UIImageView = {
  14 + var obj = UIImageView()
  15 + obj.image = UIImage(named: "Apartman")
  16 + return obj
  17 + }()
  18 +
  19 + var clientNameLabel: UILabel = {
  20 + var obj = UILabel()
  21 + obj.text = "Bares Family"
  22 + obj.textColor = UIColor(red: 0.196, green: 0.216, blue: 0.333, alpha: 1)
  23 + obj.font = .skModernist(type: .bold, ofSize: 16)
  24 + return obj
  25 + }()
  26 +
  27 + var adressLabel: UILabel = {
  28 + var obj = UILabel()
  29 + obj.text = "200 5th Ave"
  30 + obj.textColor = UIColor(red: 0.725, green: 0.725, blue: 0.725, alpha: 1)
  31 + obj.font = .skModernist(type: .regular, ofSize: 14)
  32 + return obj
  33 + }()
  34 +
  35 + var nextPointerImage: UIImageView = {
  36 + var obj = UIImageView()
  37 + obj.image = UIImage(named: "NextPointer")
  38 + return obj
  39 + }()
  40 +
  41 + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
  42 + super.init(style: style, reuseIdentifier: reuseIdentifier)
  43 + layout()
  44 + }
  45 +
  46 + required init?(coder: NSCoder) {
  47 + fatalError("init(coder:) has not been implemented")
  48 + }
  49 +
  50 + func layout() {
  51 + addSubview(apartmanImage)
  52 + addSubview(clientNameLabel)
  53 + addSubview(adressLabel)
  54 + addSubview(nextPointerImage)
  55 +
  56 + apartmanImage.snp.makeConstraints {
  57 + $0.top.equalToSuperview().offset(8)
  58 + $0.leading.equalToSuperview()
  59 + }
  60 + clientNameLabel.snp.makeConstraints {
  61 + $0.top.equalToSuperview().offset(20)
  62 + $0.leading.equalTo(apartmanImage.snp.trailing).offset(18)
  63 + }
  64 + adressLabel.snp.makeConstraints {
  65 + $0.top.equalTo(clientNameLabel.snp.bottom).offset(5)
  66 + $0.leading.equalTo(clientNameLabel.snp.leading)
  67 + }
  68 + nextPointerImage.snp.makeConstraints {
  69 + $0.centerY.equalToSuperview()
  70 + $0.trailing.equalToSuperview().offset(-26)
  71 + }
  72 + }
  73 +}
... ...
  1 +//
  2 +// ChooseApartmentsView.swift
  3 +// InterQR-Internship
  4 +//
  5 +// Created by Дмитрий Тимофеев on 14.06.2022.
  6 +//
  7 +
  8 +import UIKit
  9 +
  10 +class ChooseApartmentView: UIView {
  11 +
  12 + var backButton: UIButton = {
  13 + var obj = UIButton()
  14 + obj.setImage(UIImage(named: "BackPointer"), for: .normal)
  15 + obj.backgroundColor = .white
  16 + obj.layer.borderColor = UIColor(red: 224/255, green: 231/255, blue: 232/255, alpha: 1).cgColor
  17 + obj.layer.cornerRadius = 13
  18 + obj.layer.borderWidth = 1
  19 + return obj
  20 + }()
  21 +
  22 + var logoImage: UIImageView = {
  23 + var obj = UIImageView()
  24 + obj.image = UIImage(named: "InterQR")
  25 + return obj
  26 + }()
  27 +
  28 + var tickImage: UIImageView = {
  29 + var obj = UIImageView()
  30 + obj.image = UIImage(named: "Mask")
  31 + return obj
  32 + }()
  33 +
  34 + let apartmentsLabel: UILabel = {
  35 + var obj = UILabel()
  36 + obj.font = .skModernist(type: .bold, ofSize: 35)
  37 + obj.text = "Choose\napartman"
  38 + obj.numberOfLines = 0
  39 + return obj
  40 + }()
  41 +
  42 + var tableView: UITableView = {
  43 + var obj = UITableView()
  44 + obj.allowsSelection = false
  45 + obj.showsVerticalScrollIndicator = false
  46 + return obj
  47 + }()
  48 +
  49 + override init(frame: CGRect) {
  50 + super.init(frame: frame)
  51 + backgroundColor = .white
  52 + layout()
  53 + }
  54 +
  55 + required init?(coder: NSCoder) {
  56 + fatalError("init(coder:) has not been implemented")
  57 + }
  58 +
  59 + func layout() {
  60 + addSubview(backButton)
  61 + addSubview(logoImage)
  62 + addSubview(tickImage)
  63 + addSubview(apartmentsLabel)
  64 + addSubview(tableView)
  65 +
  66 + backButton.snp.makeConstraints {
  67 + $0.top.equalTo(snp.top).offset(66)
  68 + $0.leading.equalTo(snp.leading).offset(25)
  69 + $0.height.width.equalTo(45)
  70 + }
  71 + logoImage.snp.makeConstraints {
  72 + $0.leading.equalTo(backButton.snp.trailing).offset(20)
  73 + $0.top.equalTo(snp.top).offset(79)
  74 + }
  75 + tickImage.snp.makeConstraints {
  76 + $0.trailing.equalTo(snp.trailing)
  77 + $0.top.equalTo(snp.top).offset(106)
  78 + }
  79 + apartmentsLabel.snp.makeConstraints {
  80 + $0.leading.equalTo(backButton.snp.leading)
  81 + $0.top.equalTo(backButton.snp.bottom).offset(46)
  82 + }
  83 +
  84 + tableView.snp.makeConstraints { make in
  85 + make.leading.trailing.equalToSuperview()
  86 + make.top.equalTo(apartmentsLabel.snp.bottom).offset(85)
  87 + make.bottom.equalToSuperview()
  88 + }
  89 + }
  90 +}
... ...
  1 +//
  2 +// ChooseApartmentsViewController.swift
  3 +// InterQR-Internship
  4 +//
  5 +// Created by Дмитрий Тимофеев on 14.06.2022.
  6 +//
  7 +
  8 +import UIKit
  9 +
  10 +class ChooseApartmentsViewController: UIViewController {
  11 +
  12 + var mainView = ChooseApartmentView()
  13 +
  14 + override func loadView() {
  15 + view = mainView
  16 + }
  17 +
  18 + override func viewDidLoad() {
  19 + super.viewDidLoad()
  20 + initViewController()
  21 + }
  22 +
  23 + func initViewController() {
  24 + mainView.tableView.delegate = self
  25 + mainView.tableView.dataSource = self
  26 + mainView.tableView.register(ChooseApartmentsTableViewCell.self, forCellReuseIdentifier: ChooseApartmentsTableViewCell.id)
  27 + }
  28 +}
  29 +extension ChooseApartmentsViewController: UITableViewDelegate, UITableViewDataSource {
  30 + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  31 + 3
  32 + }
  33 +
  34 + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  35 + guard let cell = tableView.dequeueReusableCell(withIdentifier: ChooseApartmentsTableViewCell.id, for: indexPath) as? ChooseApartmentsTableViewCell else { return UITableViewCell() }
  36 +// cell.configureWithItem(doors[indexPath.row])
  37 + return cell
  38 + }
  39 +
  40 + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
  41 + 87
  42 + }
  43 + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
  44 +
  45 + }
  46 +
  47 +}
... ...
  1 +//
  2 +// ResidentsView.swift
  3 +// InterQR-Internship
  4 +//
  5 +// Created by Дмитрий Тимофеев on 14.06.2022.
  6 +//
  7 +
  8 +import Foundation
... ...
  1 +//
  2 +// ResidentsViewController.swift
  3 +// InterQR-Internship
  4 +//
  5 +// Created by Дмитрий Тимофеев on 14.06.2022.
  6 +//
  7 +
  8 +import Foundation
... ...
Please register or login to post a comment