Showing
15 changed files
with
186 additions
and
78 deletions
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | objects = { |
8 | 8 | |
9 | 9 | /* Begin PBXBuildFile section */ |
10 | + 008858E128786A5B00B23E08 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 008858DF28786A5B00B23E08 /* Localizable.strings */; }; | |
10 | 11 | 00A48B62285F8CDD00EF0A08 /* CodeVerificationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A48B5F285F8CDD00EF0A08 /* CodeVerificationView.swift */; }; |
11 | 12 | 00A48B63285F8CDD00EF0A08 /* CodeVerificationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A48B61285F8CDD00EF0A08 /* CodeVerificationViewController.swift */; }; |
12 | 13 | 00A48B6A285F8CEA00EF0A08 /* AddResidentsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A48B66285F8CEA00EF0A08 /* AddResidentsView.swift */; }; |
... | ... | @@ -57,6 +58,8 @@ |
57 | 58 | /* End PBXBuildFile section */ |
58 | 59 | |
59 | 60 | /* Begin PBXFileReference section */ |
61 | + 008858DC287869A100B23E08 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/LaunchScreen.strings; sourceTree = "<group>"; }; | |
62 | + 008858E028786A5B00B23E08 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = "InterQR-Internship/Base.lproj/Localizable.strings"; sourceTree = SOURCE_ROOT; }; | |
60 | 63 | 00A48B5F285F8CDD00EF0A08 /* CodeVerificationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeVerificationView.swift; sourceTree = "<group>"; }; |
61 | 64 | 00A48B61285F8CDD00EF0A08 /* CodeVerificationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeVerificationViewController.swift; sourceTree = "<group>"; }; |
62 | 65 | 00A48B66285F8CEA00EF0A08 /* AddResidentsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddResidentsView.swift; sourceTree = "<group>"; }; |
... | ... | @@ -122,6 +125,14 @@ |
122 | 125 | /* End PBXFrameworksBuildPhase section */ |
123 | 126 | |
124 | 127 | /* Begin PBXGroup section */ |
128 | + 008858E228786B5B00B23E08 /* Model */ = { | |
129 | + isa = PBXGroup; | |
130 | + children = ( | |
131 | + 00A48B67285F8CEA00EF0A08 /* ResidentModel.swift */, | |
132 | + ); | |
133 | + path = Model; | |
134 | + sourceTree = "<group>"; | |
135 | + }; | |
125 | 136 | 00A48B5D285F8CDD00EF0A08 /* OneTimePasswordScreen */ = { |
126 | 137 | isa = PBXGroup; |
127 | 138 | children = ( |
... | ... | @@ -151,9 +162,9 @@ |
151 | 162 | 00A48B64285F8CEA00EF0A08 /* AddResidentsScreen */ = { |
152 | 163 | isa = PBXGroup; |
153 | 164 | children = ( |
165 | + 008858E228786B5B00B23E08 /* Model */, | |
154 | 166 | 00A48B68285F8CEA00EF0A08 /* ViewController */, |
155 | 167 | 00A48B65285F8CEA00EF0A08 /* View */, |
156 | - 00A48B67285F8CEA00EF0A08 /* ResidentModel.swift */, | |
157 | 168 | ); |
158 | 169 | path = AddResidentsScreen; |
159 | 170 | sourceTree = "<group>"; |
... | ... | @@ -516,6 +527,7 @@ |
516 | 527 | 17FD60D82848A2CE00957A3A /* Resources */ = { |
517 | 528 | isa = PBXGroup; |
518 | 529 | children = ( |
530 | + 008858DF28786A5B00B23E08 /* Localizable.strings */, | |
519 | 531 | 17FD60D92848A56900957A3A /* Fonts */, |
520 | 532 | ); |
521 | 533 | path = Resources; |
... | ... | @@ -592,6 +604,7 @@ |
592 | 604 | knownRegions = ( |
593 | 605 | en, |
594 | 606 | Base, |
607 | + uk, | |
595 | 608 | ); |
596 | 609 | mainGroup = 17CF9ED42844ED8F000D8077; |
597 | 610 | productRefGroup = 17CF9EDE2844ED8F000D8077 /* Products */; |
... | ... | @@ -609,6 +622,7 @@ |
609 | 622 | buildActionMask = 2147483647; |
610 | 623 | files = ( |
611 | 624 | 17CF9EED2844ED90000D8077 /* LaunchScreen.storyboard in Resources */, |
625 | + 008858E128786A5B00B23E08 /* Localizable.strings in Resources */, | |
612 | 626 | 17287C6D2848C69600AA7113 /* Sk-Modernist-Mono.otf in Resources */, |
613 | 627 | 17287C692848C69600AA7113 /* Sk-Modernist-Bold.otf in Resources */, |
614 | 628 | 17287C6A2848C69600AA7113 /* Sk-Modernist-Regular.otf in Resources */, |
... | ... | @@ -712,10 +726,19 @@ |
712 | 726 | /* End PBXSourcesBuildPhase section */ |
713 | 727 | |
714 | 728 | /* Begin PBXVariantGroup section */ |
729 | + 008858DF28786A5B00B23E08 /* Localizable.strings */ = { | |
730 | + isa = PBXVariantGroup; | |
731 | + children = ( | |
732 | + 008858E028786A5B00B23E08 /* Base */, | |
733 | + ); | |
734 | + name = Localizable.strings; | |
735 | + sourceTree = "<group>"; | |
736 | + }; | |
715 | 737 | 17CF9EEB2844ED90000D8077 /* LaunchScreen.storyboard */ = { |
716 | 738 | isa = PBXVariantGroup; |
717 | 739 | children = ( |
718 | 740 | 17CF9EEC2844ED90000D8077 /* Base */, |
741 | + 008858DC287869A100B23E08 /* uk */, | |
719 | 742 | ); |
720 | 743 | name = LaunchScreen.storyboard; |
721 | 744 | sourceTree = "<group>"; |
... | ... | @@ -727,6 +750,7 @@ |
727 | 750 | isa = XCBuildConfiguration; |
728 | 751 | buildSettings = { |
729 | 752 | ALWAYS_SEARCH_USER_PATHS = NO; |
753 | + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; | |
730 | 754 | CLANG_ANALYZER_NONNULL = YES; |
731 | 755 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; |
732 | 756 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; |
... | ... | @@ -788,6 +812,7 @@ |
788 | 812 | isa = XCBuildConfiguration; |
789 | 813 | buildSettings = { |
790 | 814 | ALWAYS_SEARCH_USER_PATHS = NO; |
815 | + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; | |
791 | 816 | CLANG_ANALYZER_NONNULL = YES; |
792 | 817 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; |
793 | 818 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; |
... | ... | @@ -848,7 +873,7 @@ |
848 | 873 | CODE_SIGN_IDENTITY = "Apple Development"; |
849 | 874 | CODE_SIGN_STYLE = Automatic; |
850 | 875 | CURRENT_PROJECT_VERSION = 1; |
851 | - DEVELOPMENT_TEAM = 4X46JG9W6V; | |
876 | + DEVELOPMENT_TEAM = 52KCA3JZ59; | |
852 | 877 | GENERATE_INFOPLIST_FILE = YES; |
853 | 878 | INFOPLIST_FILE = "InterQR-Internship/Info.plist"; |
854 | 879 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; |
... | ... | @@ -877,7 +902,7 @@ |
877 | 902 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; |
878 | 903 | CODE_SIGN_STYLE = Automatic; |
879 | 904 | CURRENT_PROJECT_VERSION = 1; |
880 | - DEVELOPMENT_TEAM = 4X46JG9W6V; | |
905 | + DEVELOPMENT_TEAM = 52KCA3JZ59; | |
881 | 906 | GENERATE_INFOPLIST_FILE = YES; |
882 | 907 | INFOPLIST_FILE = "InterQR-Internship/Info.plist"; |
883 | 908 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; | ... | ... |
... | ... | @@ -14,9 +14,57 @@ |
14 | 14 | filePath = "InterQR-Internship/Modules/VerificationSceen/ViewController/VerificationViewController.swift" |
15 | 15 | startingColumnNumber = "9223372036854775807" |
16 | 16 | endingColumnNumber = "9223372036854775807" |
17 | - startingLineNumber = "117" | |
18 | - endingLineNumber = "117" | |
19 | - landmarkName = "keyboardWillHide(notification:)" | |
17 | + startingLineNumber = "128" | |
18 | + endingLineNumber = "128" | |
19 | + landmarkName = "VerificationViewController" | |
20 | + landmarkType = "21"> | |
21 | + </BreakpointContent> | |
22 | + </BreakpointProxy> | |
23 | + <BreakpointProxy | |
24 | + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | |
25 | + <BreakpointContent | |
26 | + uuid = "7E7A7FC7-3941-42FF-9D99-A8E8D38CAF4C" | |
27 | + shouldBeEnabled = "No" | |
28 | + ignoreCount = "0" | |
29 | + continueAfterRunningActions = "No" | |
30 | + filePath = "InterQR-Internship/Modules/ResidentsScreen/ViewController/ResidentsViewController.swift" | |
31 | + startingColumnNumber = "9223372036854775807" | |
32 | + endingColumnNumber = "9223372036854775807" | |
33 | + startingLineNumber = "115" | |
34 | + endingLineNumber = "115" | |
35 | + landmarkName = "didRemoveButtonTapped(cell:)" | |
36 | + landmarkType = "7"> | |
37 | + </BreakpointContent> | |
38 | + </BreakpointProxy> | |
39 | + <BreakpointProxy | |
40 | + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | |
41 | + <BreakpointContent | |
42 | + uuid = "EECC7F33-D6B0-4537-A925-697E0430E6CC" | |
43 | + shouldBeEnabled = "No" | |
44 | + ignoreCount = "0" | |
45 | + continueAfterRunningActions = "No" | |
46 | + filePath = "InterQR-Internship/Modules/VerificationSceen/ViewController/VerificationViewController.swift" | |
47 | + startingColumnNumber = "9223372036854775807" | |
48 | + endingColumnNumber = "9223372036854775807" | |
49 | + startingLineNumber = "83" | |
50 | + endingLineNumber = "83" | |
51 | + landmarkName = "didCheckboxTapped(_:)" | |
52 | + landmarkType = "7"> | |
53 | + </BreakpointContent> | |
54 | + </BreakpointProxy> | |
55 | + <BreakpointProxy | |
56 | + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | |
57 | + <BreakpointContent | |
58 | + uuid = "3F979C60-D565-4FB5-BB07-FBEE9DA2B47C" | |
59 | + shouldBeEnabled = "No" | |
60 | + ignoreCount = "0" | |
61 | + continueAfterRunningActions = "No" | |
62 | + filePath = "InterQR-Internship/Modules/VerificationSceen/View/VerificationView.swift" | |
63 | + startingColumnNumber = "9223372036854775807" | |
64 | + endingColumnNumber = "9223372036854775807" | |
65 | + startingLineNumber = "329" | |
66 | + endingLineNumber = "329" | |
67 | + landmarkName = "handleUI(_:)" | |
20 | 68 | landmarkType = "7"> |
21 | 69 | </BreakpointContent> |
22 | 70 | </BreakpointProxy> | ... | ... |
... | ... | @@ -11,7 +11,6 @@ import ContactsUI |
11 | 11 | class AddResidentsViewController: UIViewController { |
12 | 12 | var isKeyboardAppear = false |
13 | 13 | |
14 | - var savedResidents: [ResidentModel] = [] | |
15 | 14 | weak var delegate: ResidentSavable? |
16 | 15 | |
17 | 16 | var contact = ContactPickerViewController() |
... | ... | @@ -70,20 +69,12 @@ class AddResidentsViewController: UIViewController { |
70 | 69 | else { |
71 | 70 | return |
72 | 71 | } |
73 | - let model = [ResidentModel(name: name, | |
72 | + let model = ResidentModel(name: name, | |
74 | 73 | mobileNumber: mobileNumber, |
75 | 74 | manager: mainView.managerButton.isSelected, |
76 | 75 | hidden: mainView.hiddenButton.isSelected, |
77 | - heart: mainView.heartButton.isSelected)] | |
78 | - savedResidents.append(contentsOf: model) | |
79 | - delegate?.save(savedResidents) | |
80 | - // ??????????????????????????????? | |
81 | - mainView.nameTextField.text = "" //??? | |
82 | - mainView.mobileNumberTextField.text = "" //??? | |
83 | - mainView.managerButton.isSelected = false //??? | |
84 | - mainView.hiddenButton.isSelected = false //??? | |
85 | - mainView.heartButton.isSelected = false //??? | |
86 | - // ??????????????????????????????? | |
76 | + heart: mainView.heartButton.isSelected) | |
77 | + delegate?.save(model) | |
87 | 78 | } |
88 | 79 | |
89 | 80 | @objc private func didTapOnChangeableButtons(_ sender: SquereCheckbox) { | ... | ... |
InterQR-Internship/Modules/OneTimePasswordScreen/ViewController/CodeVerificationViewController.swift
... | ... | @@ -39,9 +39,10 @@ class CodeVerificationViewController: UIViewController { |
39 | 39 | func networkingVerify() { |
40 | 40 | guard let verifyUrl = URL(string: Constants.APIRoutes.verifyURL.urlString) else { return } |
41 | 41 | let verifyModel = verifyModelFilling() |
42 | - networkManager.verifyRequest(verifyUrl, model: verifyModel!) { response in | |
42 | + AuthNetworkManager.share.verifyRequest(verifyUrl, model: verifyModel!) { response in | |
43 | 43 | print("3️⃣✅\(response.data)") |
44 | 44 | print("\(response.message)✅") |
45 | + self.networkingLogin() | |
45 | 46 | self.mainView.spinner.startAnimating() |
46 | 47 | } fail: { error in |
47 | 48 | print("3️⃣\(error)") |
... | ... | @@ -55,6 +56,7 @@ class CodeVerificationViewController: UIViewController { |
55 | 56 | self.networkManager.loginRequest(loginUrl, model: loginModel) { response in |
56 | 57 | guard let message = response.message else { return } |
57 | 58 | print("4️⃣✅\(message)✅") |
59 | + self.errorProcessing() | |
58 | 60 | } fail: { error in |
59 | 61 | print("4️⃣⛔️\(error)⛔️") |
60 | 62 | } |
... | ... | @@ -76,7 +78,6 @@ class CodeVerificationViewController: UIViewController { |
76 | 78 | //MARK: - Targets |
77 | 79 | extension CodeVerificationViewController { |
78 | 80 | @objc private func didTapVerifyButton() { |
79 | - errorProcessing() | |
80 | 81 | networkingVerify() |
81 | 82 | } |
82 | 83 | |
... | ... | @@ -97,12 +98,8 @@ extension CodeVerificationViewController { |
97 | 98 | mainView.errorAlertLabel.isHidden = false |
98 | 99 | mainView.otpView.textField.becomeFirstResponder() |
99 | 100 | } else { |
100 | - DispatchQueue.main.asyncAfter(deadline: .now() + 2) { | |
101 | - self.networkingLogin() | |
102 | 101 | self.mainView.spinner.stopAnimating() |
103 | 102 | self.showHomeVC() |
104 | - } | |
105 | - | |
106 | 103 | } |
107 | 104 | } |
108 | 105 | } | ... | ... |
... | ... | @@ -7,7 +7,29 @@ |
7 | 7 | |
8 | 8 | import UIKit |
9 | 9 | |
10 | +protocol ResidentTableViewCellDelegate: AnyObject { | |
11 | + func didRemoveButtonTapped(cell: ResidentTableViewCell) | |
12 | + func didManagerButtonTapped(cell: ResidentTableViewCell) | |
13 | + func didHiddenButtonTapped(cell: ResidentTableViewCell) | |
14 | + func didHeardButtonTapped(cell: ResidentTableViewCell) | |
15 | + | |
16 | +} | |
17 | + | |
10 | 18 | class ResidentTableViewCell: UITableViewCell { |
19 | + var model: ResidentModel? { | |
20 | + didSet { | |
21 | + if let model = model { | |
22 | + nameLabel.text = model.name | |
23 | + phoneNumberLabel.text = model.mobileNumber | |
24 | + managerButton.isSelected = model.manager | |
25 | + hiddenButton.isSelected = model.hidden | |
26 | + heartButton.isSelected = model.heart | |
27 | + } | |
28 | + } | |
29 | + } | |
30 | + | |
31 | + weak var delegate: ResidentTableViewCellDelegate? | |
32 | + | |
11 | 33 | static let id = String(describing: ResidentTableViewCell.self) |
12 | 34 | |
13 | 35 | var containerView: UIView = { |
... | ... | @@ -67,7 +89,7 @@ class ResidentTableViewCell: UITableViewCell { |
67 | 89 | }() |
68 | 90 | |
69 | 91 | var heartButton: UIButton = { |
70 | - var obj = UIButton() | |
92 | + var obj = UIButton(type: .system) | |
71 | 93 | obj.setImage(UIImage(named: .Image.heart), for: .normal) |
72 | 94 | obj.setImage(UIImage(named: .Image.heartRed), for: .selected) |
73 | 95 | return obj |
... | ... | @@ -160,6 +182,8 @@ class ResidentTableViewCell: UITableViewCell { |
160 | 182 | $0.bottom.equalToSuperview().offset(-18) |
161 | 183 | $0.trailing.equalToSuperview().offset(-22) |
162 | 184 | } |
185 | + | |
186 | + removeCellButton.addTarget(self, action: #selector(didRemoveButtonTapped(_:)), for: .touchUpInside) | |
163 | 187 | } |
164 | 188 | |
165 | 189 | override func layoutSubviews() { |
... | ... | @@ -167,13 +191,11 @@ class ResidentTableViewCell: UITableViewCell { |
167 | 191 | gradientBG.frame = serialNumberView.bounds |
168 | 192 | } |
169 | 193 | |
170 | - func model(_ item: ResidentModel) { | |
171 | - nameLabel.text = item.name | |
172 | - phoneNumberLabel.text = item.mobileNumber | |
173 | - managerButton.isSelected = item.manager | |
174 | - hiddenButton.isSelected = item.hidden | |
175 | - heartButton.isSelected = item.heart | |
194 | +} | |
195 | + | |
196 | +//MARK: targets | |
197 | +extension ResidentTableViewCell { | |
198 | + @objc private func didRemoveButtonTapped(_ sender: UIButton) { | |
199 | + delegate?.didRemoveButtonTapped(cell: self) | |
176 | 200 | } |
177 | - | |
178 | - | |
179 | 201 | } | ... | ... |
... | ... | @@ -11,7 +11,6 @@ class ResidentsViewController: UIViewController { |
11 | 11 | var mainView = ResidentsView() |
12 | 12 | var myData: [ResidentModel] = [] |
13 | 13 | |
14 | - let addResidentsVC = AddResidentsViewController() | |
15 | 14 | let networkManager = AuthNetworkManager() |
16 | 15 | |
17 | 16 | override func loadView() { |
... | ... | @@ -62,6 +61,7 @@ class ResidentsViewController: UIViewController { |
62 | 61 | } |
63 | 62 | |
64 | 63 | @objc private func willShowAddResidentVC() { |
64 | + let addResidentsVC = AddResidentsViewController() | |
65 | 65 | addResidentsVC.modalPresentationStyle = .overCurrentContext |
66 | 66 | addResidentsVC.modalTransitionStyle = .crossDissolve |
67 | 67 | addResidentsVC.delegate = self |
... | ... | @@ -79,12 +79,8 @@ extension ResidentsViewController: UITableViewDelegate, UITableViewDataSource { |
79 | 79 | guard let cell = tableView.dequeueReusableCell(withIdentifier: ResidentTableViewCell.id, for: indexPath) as? ResidentTableViewCell else { return UITableViewCell() } |
80 | 80 | cell.serialNumberLabel.text = "\(indexPath.row + 1)" |
81 | 81 | let data = myData[indexPath.row] |
82 | - cell.model(data) | |
83 | - | |
84 | - cell.removeCellButton.addTarget(self, action: #selector(removeCell(_:)), for: .touchUpInside) | |
85 | - cell.managerButton.addTarget(self, action: #selector(didTapManagerButton), for: .touchUpInside) | |
86 | - cell.hiddenButton.addTarget(self, action: #selector(didTapManagerButton), for: .touchUpInside) | |
87 | - cell.heartButton.addTarget(self, action: #selector(didTapManagerButton), for: .touchUpInside) | |
82 | + cell.model = data | |
83 | + cell.delegate = self | |
88 | 84 | return cell |
89 | 85 | } |
90 | 86 | |
... | ... | @@ -104,8 +100,33 @@ extension ResidentsViewController: UITableViewDelegate, UITableViewDataSource { |
104 | 100 | } |
105 | 101 | //MARK: - ResidentSavable delegate |
106 | 102 | extension ResidentsViewController: ResidentSavable { |
107 | - func save(_ data: [ResidentModel]) { | |
108 | - self.myData = data | |
103 | + func save(_ data: ResidentModel) { | |
104 | + self.myData.append(data) | |
109 | 105 | mainView.tableView.reloadData() |
110 | 106 | } |
111 | 107 | } |
108 | + | |
109 | +//MARK: residentcell delegate | |
110 | +extension ResidentsViewController: ResidentTableViewCellDelegate { | |
111 | + func didRemoveButtonTapped(cell: ResidentTableViewCell) { | |
112 | + guard let model = cell.model else { | |
113 | + return | |
114 | + } | |
115 | + myData.removeAll(where: {$0.name == model.name}) | |
116 | + mainView.tableView.reloadData() | |
117 | + } | |
118 | + | |
119 | + func didManagerButtonTapped(cell: ResidentTableViewCell) { | |
120 | + print("") | |
121 | + } | |
122 | + | |
123 | + func didHiddenButtonTapped(cell: ResidentTableViewCell) { | |
124 | + print("") | |
125 | + } | |
126 | + | |
127 | + func didHeardButtonTapped(cell: ResidentTableViewCell) { | |
128 | + print("") | |
129 | + } | |
130 | + | |
131 | + | |
132 | +} | ... | ... |
... | ... | @@ -10,11 +10,11 @@ import UIKit |
10 | 10 | |
11 | 11 | class VerificationView: UIView { |
12 | 12 | var isShow: Bool = false |
13 | - var isChanged: Bool = false { | |
14 | - didSet { | |
15 | - handleUI(isChanged) | |
16 | - } | |
17 | - } | |
13 | +// var isChanged: Bool = false { | |
14 | +// didSet { | |
15 | +// handleUI(isChanged) | |
16 | +// } | |
17 | +// } | |
18 | 18 | var logoImage: UIImageView = { |
19 | 19 | var view = UIImageView() |
20 | 20 | view.image = UIImage(named: .Image.interQR) |
... | ... | @@ -326,29 +326,11 @@ class VerificationView: UIView { |
326 | 326 | } |
327 | 327 | |
328 | 328 | func handleUI(_ isChanged: Bool) { |
329 | - switch isChanged { | |
330 | - case emailButton.isSelected : | |
331 | - emailTextField.isHidden = false | |
332 | - phoneTextField.isHidden = true | |
333 | - phoneNumberButton.isSelected = false | |
334 | - emailButton.isSelected = true | |
335 | - verificationDescriptionLabel.text = .Text.verificationCodeWillBeSentToYourEmail | |
336 | - enterChosenAuthenticatorLabel.text = .Text.enterYourEmailAddress | |
337 | - emailTextField.text = "" | |
338 | - emailTextField.placeholder = .Text.exampleEmail | |
339 | - showPickerButton.isHidden = true | |
340 | - case phoneNumberButton.isSelected : | |
341 | - emailTextField.isHidden = true | |
342 | - phoneTextField.isHidden = false | |
343 | - phoneNumberButton.isSelected = true | |
344 | - emailButton.isSelected = false | |
345 | - phoneNumberButton.image(for: .normal) | |
346 | - verificationDescriptionLabel.text = .Text.verificationCodeWillBeSentToYourNumber | |
347 | - enterChosenAuthenticatorLabel.text = .Text.enterYourPhoneNumber | |
348 | - emailTextField.text = .Text.plusOne | |
349 | - showPickerButton.isHidden = false | |
350 | - default : | |
351 | - return | |
352 | - } | |
329 | + emailTextField.isHidden = !isChanged | |
330 | + phoneTextField.isHidden = isChanged | |
331 | + verificationDescriptionLabel.text = isChanged ? .Text.verificationCodeWillBeSentToYourEmail : .Text.verificationCodeWillBeSentToYourNumber | |
332 | + enterChosenAuthenticatorLabel.text = isChanged ? .Text.enterYourEmailAddress : .Text.enterYourPhoneNumber | |
333 | + emailTextField.text = isChanged ? "" : .Text.plusOne | |
334 | + showPickerButton.isHidden = isChanged | |
353 | 335 | } |
354 | 336 | } | ... | ... |
... | ... | @@ -80,8 +80,19 @@ extension VerificationViewController { |
80 | 80 | //MARK: targets |
81 | 81 | extension VerificationViewController { |
82 | 82 | @objc private func didCheckboxTapped(_ sender: Checkbox) { |
83 | - mainView.isChanged ? mainView.handleUI(true) : mainView.handleUI(false) | |
84 | - mainView.isChanged.toggle() | |
83 | + switch sender { | |
84 | + case mainView.emailButton : | |
85 | + sender.isSelected = true | |
86 | + mainView.phoneNumberButton.isSelected = false | |
87 | + mainView.handleUI(true) | |
88 | + case mainView.phoneNumberButton: | |
89 | + sender.isSelected = true | |
90 | + mainView.emailButton.isSelected = false | |
91 | + mainView.handleUI(false) | |
92 | + default: | |
93 | + return | |
94 | + } | |
95 | +// mainView.handleUI(mainView.emailButton.isSelected) | |
85 | 96 | } |
86 | 97 | |
87 | 98 | @objc private func didshowPickerButtonTapped(_ sender: UIButton) { | ... | ... |
... | ... | @@ -19,7 +19,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { |
19 | 19 | let viewController = VerificationViewController() |
20 | 20 | let homeVC = HomeViewController() |
21 | 21 | let residentVC = ResidentsViewController() |
22 | - let navigation = UINavigationController(rootViewController: residentVC) | |
22 | + let navigation = UINavigationController(rootViewController: viewController) | |
23 | 23 | navigation.isNavigationBarHidden = true |
24 | 24 | window?.rootViewController = navigation |
25 | 25 | window?.makeKeyAndVisible() | ... | ... |
1 | + | ... | ... |
... | ... | @@ -4,20 +4,27 @@ |
4 | 4 | <dict> |
5 | 5 | <key>SchemeUserState</key> |
6 | 6 | <dict> |
7 | - <key>Pods-InterQR-Internship.xcscheme</key> | |
7 | + <key>Alamofire.xcscheme</key> | |
8 | 8 | <dict> |
9 | 9 | <key>isShown</key> |
10 | 10 | <false/> |
11 | 11 | <key>orderHint</key> |
12 | 12 | <integer>0</integer> |
13 | 13 | </dict> |
14 | - <key>SnapKit.xcscheme</key> | |
14 | + <key>Pods-InterQR-Internship.xcscheme</key> | |
15 | 15 | <dict> |
16 | 16 | <key>isShown</key> |
17 | 17 | <false/> |
18 | 18 | <key>orderHint</key> |
19 | 19 | <integer>1</integer> |
20 | 20 | </dict> |
21 | + <key>SnapKit.xcscheme</key> | |
22 | + <dict> | |
23 | + <key>isShown</key> | |
24 | + <false/> | |
25 | + <key>orderHint</key> | |
26 | + <integer>2</integer> | |
27 | + </dict> | |
21 | 28 | </dict> |
22 | 29 | <key>SuppressBuildableAutocreation</key> |
23 | 30 | <dict/> | ... | ... |
Please
register
or
login
to post a comment