Commit 98fa37c309a5bb612313284059746ed9dc3216d4

Authored by Dmitriy Tymofyeyev
1 parent 22a64cd8

code refactoring

Showing 182 changed files with 591 additions and 15 deletions
  1 +//
  2 +// Colors + extension.swift
  3 +// InterQR-Internship
  4 +//
  5 +// Created by Дмитрий Тимофеев on 19.06.2022.
  6 +//
  7 +
  8 +import Foundation
... ...
  1 +{
  2 + "images" : [
  3 + {
  4 + "filename" : "3Users.png",
  5 + "idiom" : "universal",
  6 + "scale" : "1x"
  7 + },
  8 + {
  9 + "filename" : "3 User@2x.png",
  10 + "idiom" : "universal",
  11 + "scale" : "2x"
  12 + },
  13 + {
  14 + "filename" : "3 User@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" : "EmptySquere.png",
  5 + "idiom" : "universal",
  6 + "scale" : "1x"
  7 + },
  8 + {
  9 + "filename" : "Rectangle 8@2x.png",
  10 + "idiom" : "universal",
  11 + "scale" : "2x"
  12 + },
  13 + {
  14 + "filename" : "Rectangle 8@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" : "FullSquere.png",
  5 + "idiom" : "universal",
  6 + "scale" : "1x"
  7 + },
  8 + {
  9 + "filename" : "Group 33542@2x.png",
  10 + "idiom" : "universal",
  11 + "scale" : "2x"
  12 + },
  13 + {
  14 + "filename" : "Group 33542@3x.png",
  15 + "idiom" : "universal",
  16 + "scale" : "3x"
  17 + }
  18 + ],
  19 + "info" : {
  20 + "author" : "xcode",
  21 + "version" : 1
  22 + }
  23 +}
... ...
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
  1 +{
  2 + "images" : [
  3 + {
  4 + "filename" : "Bin.png",
  5 + "idiom" : "universal",
  6 + "scale" : "1x"
  7 + },
  8 + {
  9 + "filename" : "Delete@2x.png",
  10 + "idiom" : "universal",
  11 + "scale" : "2x"
  12 + },
  13 + {
  14 + "filename" : "Delete@3x.png",
  15 + "idiom" : "universal",
  16 + "scale" : "3x"
  17 + }
  18 + ],
  19 + "info" : {
  20 + "author" : "xcode",
  21 + "version" : 1
  22 + }
  23 +}
... ...
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
  1 +{
  2 + "images" : [
  3 + {
  4 + "filename" : "Plus.png",
  5 + "idiom" : "universal",
  6 + "scale" : "1x"
  7 + },
  8 + {
  9 + "filename" : "Group 33489@2x.png",
  10 + "idiom" : "universal",
  11 + "scale" : "2x"
  12 + },
  13 + {
  14 + "filename" : "Group 33489@3x.png",
  15 + "idiom" : "universal",
  16 + "scale" : "3x"
  17 + }
  18 + ],
  19 + "info" : {
  20 + "author" : "xcode",
  21 + "version" : 1
  22 + }
  23 +}
... ...
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
  1 +{
  2 + "colors" : [
  3 + {
  4 + "color" : {
  5 + "color-space" : "srgb",
  6 + "components" : {
  7 + "alpha" : "1.000",
  8 + "blue" : "0.545",
  9 + "green" : "0.267",
  10 + "red" : "0.000"
  11 + }
  12 + },
  13 + "idiom" : "universal"
  14 + },
  15 + {
  16 + "appearances" : [
  17 + {
  18 + "appearance" : "luminosity",
  19 + "value" : "dark"
  20 + }
  21 + ],
  22 + "color" : {
  23 + "color-space" : "srgb",
  24 + "components" : {
  25 + "alpha" : "1.000",
  26 + "blue" : "1.000",
  27 + "green" : "1.000",
  28 + "red" : "1.000"
  29 + }
  30 + },
  31 + "idiom" : "universal"
  32 + }
  33 + ],
  34 + "info" : {
  35 + "author" : "xcode",
  36 + "version" : 1
  37 + }
  38 +}
... ...
  1 +{
  2 + "colors" : [
  3 + {
  4 + "color" : {
  5 + "color-space" : "srgb",
  6 + "components" : {
  7 + "alpha" : "1.000",
  8 + "blue" : "0.910",
  9 + "green" : "0.910",
  10 + "red" : "0.882"
  11 + }
  12 + },
  13 + "idiom" : "universal"
  14 + },
  15 + {
  16 + "appearances" : [
  17 + {
  18 + "appearance" : "luminosity",
  19 + "value" : "dark"
  20 + }
  21 + ],
  22 + "color" : {
  23 + "color-space" : "srgb",
  24 + "components" : {
  25 + "alpha" : "1.000",
  26 + "blue" : "1.000",
  27 + "green" : "1.000",
  28 + "red" : "1.000"
  29 + }
  30 + },
  31 + "idiom" : "universal"
  32 + }
  33 + ],
  34 + "info" : {
  35 + "author" : "xcode",
  36 + "version" : 1
  37 + }
  38 +}
... ...
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
  1 +{
  2 + "colors" : [
  3 + {
  4 + "color" : {
  5 + "color-space" : "srgb",
  6 + "components" : {
  7 + "alpha" : "1.000",
  8 + "blue" : "0.545",
  9 + "green" : "0.257",
  10 + "red" : "0.000"
  11 + }
  12 + },
  13 + "idiom" : "universal"
  14 + },
  15 + {
  16 + "appearances" : [
  17 + {
  18 + "appearance" : "luminosity",
  19 + "value" : "dark"
  20 + }
  21 + ],
  22 + "color" : {
  23 + "color-space" : "srgb",
  24 + "components" : {
  25 + "alpha" : "1.000",
  26 + "blue" : "1.000",
  27 + "green" : "1.000",
  28 + "red" : "1.000"
  29 + }
  30 + },
  31 + "idiom" : "universal"
  32 + }
  33 + ],
  34 + "info" : {
  35 + "author" : "xcode",
  36 + "version" : 1
  37 + }
  38 +}
... ...
  1 +{
  2 + "colors" : [
  3 + {
  4 + "color" : {
  5 + "color-space" : "srgb",
  6 + "components" : {
  7 + "alpha" : "1.000",
  8 + "blue" : "0.827",
  9 + "green" : "0.561",
  10 + "red" : "0.000"
  11 + }
  12 + },
  13 + "idiom" : "universal"
  14 + },
  15 + {
  16 + "appearances" : [
  17 + {
  18 + "appearance" : "luminosity",
  19 + "value" : "dark"
  20 + }
  21 + ],
  22 + "color" : {
  23 + "color-space" : "srgb",
  24 + "components" : {
  25 + "alpha" : "1.000",
  26 + "blue" : "1.000",
  27 + "green" : "1.000",
  28 + "red" : "1.000"
  29 + }
  30 + },
  31 + "idiom" : "universal"
  32 + }
  33 + ],
  34 + "info" : {
  35 + "author" : "xcode",
  36 + "version" : 1
  37 + }
  38 +}
... ...
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
  1 +{
  2 + "colors" : [
  3 + {
  4 + "color" : {
  5 + "color-space" : "srgb",
  6 + "components" : {
  7 + "alpha" : "1.000",
  8 + "blue" : "0.333",
  9 + "green" : "0.216",
  10 + "red" : "0.196"
  11 + }
  12 + },
  13 + "idiom" : "iphone"
  14 + },
  15 + {
  16 + "appearances" : [
  17 + {
  18 + "appearance" : "luminosity",
  19 + "value" : "dark"
  20 + }
  21 + ],
  22 + "color" : {
  23 + "color-space" : "srgb",
  24 + "components" : {
  25 + "alpha" : "1.000",
  26 + "blue" : "1.000",
  27 + "green" : "1.000",
  28 + "red" : "1.000"
  29 + }
  30 + },
  31 + "idiom" : "iphone"
  32 + }
  33 + ],
  34 + "info" : {
  35 + "author" : "xcode",
  36 + "version" : 1
  37 + },
  38 + "properties" : {
  39 + "localizable" : true
  40 + }
  41 +}
... ...
  1 +{
  2 + "colors" : [
  3 + {
  4 + "color" : {
  5 + "color-space" : "srgb",
  6 + "components" : {
  7 + "alpha" : "1.000",
  8 + "blue" : "0.725",
  9 + "green" : "0.725",
  10 + "red" : "0.725"
  11 + }
  12 + },
  13 + "idiom" : "universal"
  14 + },
  15 + {
  16 + "appearances" : [
  17 + {
  18 + "appearance" : "luminosity",
  19 + "value" : "dark"
  20 + }
  21 + ],
  22 + "color" : {
  23 + "color-space" : "srgb",
  24 + "components" : {
  25 + "alpha" : "1.000",
  26 + "blue" : "1.000",
  27 + "green" : "1.000",
  28 + "red" : "1.000"
  29 + }
  30 + },
  31 + "idiom" : "universal"
  32 + }
  33 + ],
  34 + "info" : {
  35 + "author" : "xcode",
  36 + "version" : 1
  37 + }
  38 +}
... ...
  1 +{
  2 + "colors" : [
  3 + {
  4 + "color" : {
  5 + "color-space" : "srgb",
  6 + "components" : {
  7 + "alpha" : "0.980",
  8 + "blue" : "0.180",
  9 + "green" : "0.000",
  10 + "red" : "1.000"
  11 + }
  12 + },
  13 + "idiom" : "universal"
  14 + },
  15 + {
  16 + "appearances" : [
  17 + {
  18 + "appearance" : "luminosity",
  19 + "value" : "dark"
  20 + }
  21 + ],
  22 + "color" : {
  23 + "color-space" : "srgb",
  24 + "components" : {
  25 + "alpha" : "1.000",
  26 + "blue" : "1.000",
  27 + "green" : "1.000",
  28 + "red" : "1.000"
  29 + }
  30 + },
  31 + "idiom" : "universal"
  32 + }
  33 + ],
  34 + "info" : {
  35 + "author" : "xcode",
  36 + "version" : 1
  37 + }
  38 +}
... ...
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
... ... @@ -5,8 +5,8 @@
5 5 "color-space" : "srgb",
6 6 "components" : {
7 7 "alpha" : "1.000",
8   - "blue" : "1.000",
9   - "green" : "1.000",
  8 + "blue" : "0.942",
  9 + "green" : "0.929",
10 10 "red" : "1.000"
11 11 }
12 12 },
... ...
  1 +{
  2 + "colors" : [
  3 + {
  4 + "color" : {
  5 + "color-space" : "srgb",
  6 + "components" : {
  7 + "alpha" : "1.000",
  8 + "blue" : "0.954",
  9 + "green" : "0.954",
  10 + "red" : "0.954"
  11 + }
  12 + },
  13 + "idiom" : "universal"
  14 + },
  15 + {
  16 + "appearances" : [
  17 + {
  18 + "appearance" : "luminosity",
  19 + "value" : "dark"
  20 + }
  21 + ],
  22 + "color" : {
  23 + "color-space" : "srgb",
  24 + "components" : {
  25 + "alpha" : "1.000",
  26 + "blue" : "1.000",
  27 + "green" : "1.000",
  28 + "red" : "1.000"
  29 + }
  30 + },
  31 + "idiom" : "universal"
  32 + }
  33 + ],
  34 + "info" : {
  35 + "author" : "xcode",
  36 + "version" : 1
  37 + }
  38 +}
... ...
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
  1 +//
  2 +// SquereCheckBox.swift
  3 +// InterQR-Internship
  4 +//
  5 +// Created by Дмитрий Тимофеев on 17.06.2022.
  6 +//
  7 +
  8 +import Foundation
... ...
  1 +//
  2 +// ResidentModel.swift
  3 +// InterQR-Internship
  4 +//
  5 +// Created by Дмитрий Тимофеев on 18.06.2022.
  6 +//
  7 +
  8 +import Foundation
... ...
... ... @@ -8,10 +8,16 @@
8 8 import UIKit
9 9
10 10 class AddResidentsView: UIView {
  11 + let blurEffect: UIVisualEffectView = {
  12 + let blur = UIBlurEffect(style: UIBlurEffect.Style.systemMaterialDark)
  13 + let obj = UIVisualEffectView(effect: blur)
  14 + obj.autoresizingMask = [.flexibleWidth, .flexibleHeight]
  15 + obj.alpha = 0.9
  16 + return obj
  17 + }()
  18 +
11 19 var transparentView: UIView = {
12 20 var obj = UIView()
13   - obj.backgroundColor = .black
14   - obj.alpha = 0.5
15 21 return obj
16 22 }()
17 23
... ... @@ -80,7 +86,8 @@ class AddResidentsView: UIView {
80 86
81 87 var managerButton: UIButton = {
82 88 var obj = UIButton()
83   -// obj.setImage(<#T##image: UIImage?##UIImage?#>, for: <#T##UIControl.State#>)
  89 + obj.setImage(UIImage(named: ""), for: .normal)
  90 + obj.setImage(UIImage(named: ""), for: .selected)
84 91 return obj
85 92 }()
86 93
... ... @@ -131,6 +138,7 @@ class AddResidentsView: UIView {
131 138 addResidentButton.layer.insertSublayer(gradientBG, at: 0)
132 139
133 140 addSubview(transparentView)
  141 + transparentView.addSubview(blurEffect)
134 142
135 143 addSubview(containerView)
136 144 containerView.addSubview(addResidentLabeL)
... ... @@ -222,5 +230,6 @@ class AddResidentsView: UIView {
222 230 override func layoutSubviews() {
223 231 super.layoutSubviews()
224 232 gradientBG.frame = addResidentButton.bounds
  233 + blurEffect.frame = transparentView.bounds
225 234 }
226 235 }
... ...
... ... @@ -8,7 +8,6 @@
8 8 import UIKit
9 9
10 10 class AddResidentsViewController: UIViewController {
11   -
12 11 var mainView = AddResidentsView()
13 12
14 13 override func loadView() {
... ... @@ -16,5 +15,10 @@ class AddResidentsViewController: UIViewController {
16 15 }
17 16
18 17 override func viewDidLoad() {
  18 + mainView.closeButton.addTarget(self, action: #selector(didTapCloseButton), for: .touchUpInside)
  19 + }
  20 +
  21 + @objc func didTapCloseButton() {
  22 + dismiss(animated: true, completion: nil)
19 23 }
20 24 }
... ...
  1 +//
  2 +// ContactPickerViewController.swift
  3 +// InterQR-Internship
  4 +//
  5 +// Created by Дмитрий Тимофеев on 17.06.2022.
  6 +//
  7 +
  8 +import Foundation
... ...
... ... @@ -8,8 +8,7 @@
8 8 import UIKit
9 9
10 10 class HomeTableViewCell: UITableViewCell {
11   -
12   - static let id = "HomeTableViewCell-ID"
  11 + static let id = String(describing: HomeTableViewCell.self)
13 12
14 13 var containerView: UIView = {
15 14 var obj = UIView()
... ... @@ -18,12 +17,14 @@ class HomeTableViewCell: UITableViewCell {
18 17 obj.layer.borderColor = UIColor(red: 0.89, green: 0.918, blue: 0.918, alpha: 1).cgColor
19 18 return obj
20 19 }()
  20 +
21 21 var leftStatusImage: UIImageView = {
22 22 var obj = UIImageView()
23 23 obj.image = UIImage(named: "LeftBlue")
24 24 obj.contentMode = .scaleAspectFill
25 25 return obj
26 26 }()
  27 +
27 28 var doorNameLabel: UILabel = {
28 29 var obj = UILabel()
29 30 obj.font = .skModernist(type: .bold, ofSize: 16)
... ... @@ -31,6 +32,7 @@ class HomeTableViewCell: UITableViewCell {
31 32 obj.text = "Front Door"
32 33 return obj
33 34 }()
  35 +
34 36 var doorLocationLabel: UILabel = {
35 37 var obj = UILabel()
36 38 obj.textColor = UIColor(red: 0.725, green: 0.725, blue: 0.725, alpha: 1)
... ... @@ -38,6 +40,7 @@ class HomeTableViewCell: UITableViewCell {
38 40 obj.text = "Home"
39 41 return obj
40 42 }()
  43 +
41 44 var lockStatusLabel: UILabel = {
42 45 var obj = UILabel()
43 46 obj.textColor = UIColor(red: 0, green: 0.267, blue: 0.545, alpha: 1)
... ... @@ -45,11 +48,13 @@ class HomeTableViewCell: UITableViewCell {
45 48 obj.text = "Locked"
46 49 return obj
47 50 }()
  51 +
48 52 var rightStatusImage: UIImageView = {
49 53 var obj = UIImageView()
50 54 obj.image = UIImage(named: "RightBlue")
51 55 return obj
52 56 }()
  57 +
53 58 override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
54 59 super.init(style: style, reuseIdentifier: reuseIdentifier)
55 60 layout()
... ... @@ -61,6 +66,7 @@ class HomeTableViewCell: UITableViewCell {
61 66
62 67 func layout() {
63 68 selectionStyle = .none
  69 +
64 70 addSubview(containerView)
65 71 containerView.addSubview(leftStatusImage)
66 72 containerView.addSubview(doorNameLabel)
... ... @@ -73,34 +79,39 @@ class HomeTableViewCell: UITableViewCell {
73 79 $0.bottom.equalToSuperview().offset(-8)
74 80 $0.top.equalToSuperview().offset(8)
75 81 }
  82 +
76 83 leftStatusImage.snp.makeConstraints {
77 84 $0.top.equalTo(containerView.snp.top).offset(19)
78 85 $0.leading.equalTo(containerView.snp.leading).offset(23)
79 86 $0.height.width.equalTo(41)
80 87 }
  88 +
81 89 doorNameLabel.snp.makeConstraints {
82 90 $0.top.equalTo(snp.top).offset(22)
83 91 $0.leading.equalTo(leftStatusImage.snp.trailing).offset(14)
84 92 }
  93 +
85 94 doorLocationLabel.snp.makeConstraints {
86 95 $0.top.equalTo(doorNameLabel.snp.bottom)
87 96 $0.leading.equalTo(doorNameLabel.snp.leading)
88 97 }
  98 +
89 99 lockStatusLabel.snp.makeConstraints {
90 100 $0.bottom.equalTo(snp.bottom).offset(-15)
91 101 $0.centerX.equalTo(snp.centerX)
92 102 }
  103 +
93 104 rightStatusImage.snp.makeConstraints {
94 105 $0.trailing.equalTo(snp.trailing).offset(-16)
95 106 $0.top.equalTo(snp.top).offset(19)
96 107 }
97 108 }
98   -// func configureWithItem(_ item: DoorsModel) {
99   -
100   -// doorTypeLabel.text = item.purpose
101   -// doorLocationLabel.text = item.type
102   -// configureStatus(status: item.lockStatus)
103   -// rightStatusImageView.isHidden = false
104   -// }
  109 + // func configureWithItem(_ item: DoorsModel) {
  110 +
  111 + // doorTypeLabel.text = item.purpose
  112 + // doorLocationLabel.text = item.type
  113 + // configureStatus(status: item.lockStatus)
  114 + // rightStatusImageView.isHidden = false
  115 + // }
105 116 }
106 117
... ...
  1 +//
  2 +// ResidentTableViewCell.swift
  3 +// InterQR-Internship
  4 +//
  5 +// Created by Дмитрий Тимофеев on 17.06.2022.
  6 +//
  7 +
  8 +import Foundation
... ...
  1 +//
  2 +// ProtocolDelegare.swift
  3 +// InterQR-Internship
  4 +//
  5 +// Created by Дмитрий Тимофеев on 17.06.2022.
  6 +//
  7 +
  8 +import Foundation
  9 +import ContactsUI
  10 +protocol ResidentSavable: AnyObject {
  11 + func save(_ data: ResidentModel)
  12 +}
... ...
Please register or login to post a comment