Showing
9 changed files
with
84 additions
and
60 deletions
@@ -7,7 +7,6 @@ | @@ -7,7 +7,6 @@ | ||
7 | objects = { | 7 | objects = { |
8 | 8 | ||
9 | /* Begin PBXBuildFile section */ | 9 | /* Begin PBXBuildFile section */ |
10 | - 008858E128786A5B00B23E08 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 008858DF28786A5B00B23E08 /* Localizable.strings */; }; | ||
11 | 00A48B62285F8CDD00EF0A08 /* CodeVerificationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A48B5F285F8CDD00EF0A08 /* CodeVerificationView.swift */; }; | 10 | 00A48B62285F8CDD00EF0A08 /* CodeVerificationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A48B5F285F8CDD00EF0A08 /* CodeVerificationView.swift */; }; |
12 | 00A48B63285F8CDD00EF0A08 /* CodeVerificationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A48B61285F8CDD00EF0A08 /* CodeVerificationViewController.swift */; }; | 11 | 00A48B63285F8CDD00EF0A08 /* CodeVerificationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A48B61285F8CDD00EF0A08 /* CodeVerificationViewController.swift */; }; |
13 | 00A48B6A285F8CEA00EF0A08 /* AddResidentsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A48B66285F8CEA00EF0A08 /* AddResidentsView.swift */; }; | 12 | 00A48B6A285F8CEA00EF0A08 /* AddResidentsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A48B66285F8CEA00EF0A08 /* AddResidentsView.swift */; }; |
@@ -21,6 +20,7 @@ | @@ -21,6 +20,7 @@ | ||
21 | 00A48B7B285F8F6600EF0A08 /* ProtocolDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A48B79285F8F6600EF0A08 /* ProtocolDelegate.swift */; }; | 20 | 00A48B7B285F8F6600EF0A08 /* ProtocolDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A48B79285F8F6600EF0A08 /* ProtocolDelegate.swift */; }; |
22 | 00A48B7F285F8F9200EF0A08 /* ContactPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A48B7E285F8F9200EF0A08 /* ContactPickerViewController.swift */; }; | 21 | 00A48B7F285F8F9200EF0A08 /* ContactPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00A48B7E285F8F9200EF0A08 /* ContactPickerViewController.swift */; }; |
23 | 00E581BB284F71CD00E779FB /* Checkbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E581BA284F71CD00E779FB /* Checkbox.swift */; }; | 22 | 00E581BB284F71CD00E779FB /* Checkbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E581BA284F71CD00E779FB /* Checkbox.swift */; }; |
23 | + 170E2C45287C434500296FC9 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 170E2C44287C434500296FC9 /* Localizable.strings */; }; | ||
24 | 1721AEF028704E3100EC4FDB /* Strings + Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1721AEEF28704E3100EC4FDB /* Strings + Extension.swift */; }; | 24 | 1721AEF028704E3100EC4FDB /* Strings + Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1721AEEF28704E3100EC4FDB /* Strings + Extension.swift */; }; |
25 | 1721AEF228705FD600EC4FDB /* OTPView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1721AEF128705FD600EC4FDB /* OTPView.swift */; }; | 25 | 1721AEF228705FD600EC4FDB /* OTPView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1721AEF128705FD600EC4FDB /* OTPView.swift */; }; |
26 | 17287C602848AD8D00AA7113 /* Fonts + Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17287C5F2848AD8D00AA7113 /* Fonts + Extension.swift */; }; | 26 | 17287C602848AD8D00AA7113 /* Fonts + Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17287C5F2848AD8D00AA7113 /* Fonts + Extension.swift */; }; |
@@ -59,7 +59,6 @@ | @@ -59,7 +59,6 @@ | ||
59 | 59 | ||
60 | /* Begin PBXFileReference section */ | 60 | /* Begin PBXFileReference section */ |
61 | 008858DC287869A100B23E08 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/LaunchScreen.strings; sourceTree = "<group>"; }; | 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; }; | ||
63 | 00A48B5F285F8CDD00EF0A08 /* CodeVerificationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeVerificationView.swift; sourceTree = "<group>"; }; | 62 | 00A48B5F285F8CDD00EF0A08 /* CodeVerificationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeVerificationView.swift; sourceTree = "<group>"; }; |
64 | 00A48B61285F8CDD00EF0A08 /* CodeVerificationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeVerificationViewController.swift; sourceTree = "<group>"; }; | 63 | 00A48B61285F8CDD00EF0A08 /* CodeVerificationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeVerificationViewController.swift; sourceTree = "<group>"; }; |
65 | 00A48B66285F8CEA00EF0A08 /* AddResidentsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddResidentsView.swift; sourceTree = "<group>"; }; | 64 | 00A48B66285F8CEA00EF0A08 /* AddResidentsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddResidentsView.swift; sourceTree = "<group>"; }; |
@@ -73,6 +72,7 @@ | @@ -73,6 +72,7 @@ | ||
73 | 00A48B79285F8F6600EF0A08 /* ProtocolDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProtocolDelegate.swift; sourceTree = "<group>"; }; | 72 | 00A48B79285F8F6600EF0A08 /* ProtocolDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProtocolDelegate.swift; sourceTree = "<group>"; }; |
74 | 00A48B7E285F8F9200EF0A08 /* ContactPickerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactPickerViewController.swift; sourceTree = "<group>"; }; | 73 | 00A48B7E285F8F9200EF0A08 /* ContactPickerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactPickerViewController.swift; sourceTree = "<group>"; }; |
75 | 00E581BA284F71CD00E779FB /* Checkbox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Checkbox.swift; sourceTree = "<group>"; }; | 74 | 00E581BA284F71CD00E779FB /* Checkbox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Checkbox.swift; sourceTree = "<group>"; }; |
75 | + 170E2C44287C434500296FC9 /* Localizable.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = "<group>"; }; | ||
76 | 1721AEEF28704E3100EC4FDB /* Strings + Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Strings + Extension.swift"; sourceTree = "<group>"; }; | 76 | 1721AEEF28704E3100EC4FDB /* Strings + Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Strings + Extension.swift"; sourceTree = "<group>"; }; |
77 | 1721AEF128705FD600EC4FDB /* OTPView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OTPView.swift; sourceTree = "<group>"; }; | 77 | 1721AEF128705FD600EC4FDB /* OTPView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OTPView.swift; sourceTree = "<group>"; }; |
78 | 17287C5F2848AD8D00AA7113 /* Fonts + Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Fonts + Extension.swift"; sourceTree = "<group>"; }; | 78 | 17287C5F2848AD8D00AA7113 /* Fonts + Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Fonts + Extension.swift"; sourceTree = "<group>"; }; |
@@ -527,7 +527,7 @@ | @@ -527,7 +527,7 @@ | ||
527 | 17FD60D82848A2CE00957A3A /* Resources */ = { | 527 | 17FD60D82848A2CE00957A3A /* Resources */ = { |
528 | isa = PBXGroup; | 528 | isa = PBXGroup; |
529 | children = ( | 529 | children = ( |
530 | - 008858DF28786A5B00B23E08 /* Localizable.strings */, | 530 | + 170E2C44287C434500296FC9 /* Localizable.strings */, |
531 | 17FD60D92848A56900957A3A /* Fonts */, | 531 | 17FD60D92848A56900957A3A /* Fonts */, |
532 | ); | 532 | ); |
533 | path = Resources; | 533 | path = Resources; |
@@ -622,8 +622,8 @@ | @@ -622,8 +622,8 @@ | ||
622 | buildActionMask = 2147483647; | 622 | buildActionMask = 2147483647; |
623 | files = ( | 623 | files = ( |
624 | 17CF9EED2844ED90000D8077 /* LaunchScreen.storyboard in Resources */, | 624 | 17CF9EED2844ED90000D8077 /* LaunchScreen.storyboard in Resources */, |
625 | - 008858E128786A5B00B23E08 /* Localizable.strings in Resources */, | ||
626 | 17287C6D2848C69600AA7113 /* Sk-Modernist-Mono.otf in Resources */, | 625 | 17287C6D2848C69600AA7113 /* Sk-Modernist-Mono.otf in Resources */, |
626 | + 170E2C45287C434500296FC9 /* Localizable.strings in Resources */, | ||
627 | 17287C692848C69600AA7113 /* Sk-Modernist-Bold.otf in Resources */, | 627 | 17287C692848C69600AA7113 /* Sk-Modernist-Bold.otf in Resources */, |
628 | 17287C6A2848C69600AA7113 /* Sk-Modernist-Regular.otf in Resources */, | 628 | 17287C6A2848C69600AA7113 /* Sk-Modernist-Regular.otf in Resources */, |
629 | 17CF9EEA2844ED90000D8077 /* Assets.xcassets in Resources */, | 629 | 17CF9EEA2844ED90000D8077 /* Assets.xcassets in Resources */, |
@@ -726,14 +726,6 @@ | @@ -726,14 +726,6 @@ | ||
726 | /* End PBXSourcesBuildPhase section */ | 726 | /* End PBXSourcesBuildPhase section */ |
727 | 727 | ||
728 | /* Begin PBXVariantGroup section */ | 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 | - }; | ||
737 | 17CF9EEB2844ED90000D8077 /* LaunchScreen.storyboard */ = { | 729 | 17CF9EEB2844ED90000D8077 /* LaunchScreen.storyboard */ = { |
738 | isa = PBXVariantGroup; | 730 | isa = PBXVariantGroup; |
739 | children = ( | 731 | children = ( |
@@ -873,7 +865,7 @@ | @@ -873,7 +865,7 @@ | ||
873 | CODE_SIGN_IDENTITY = "Apple Development"; | 865 | CODE_SIGN_IDENTITY = "Apple Development"; |
874 | CODE_SIGN_STYLE = Automatic; | 866 | CODE_SIGN_STYLE = Automatic; |
875 | CURRENT_PROJECT_VERSION = 1; | 867 | CURRENT_PROJECT_VERSION = 1; |
876 | - DEVELOPMENT_TEAM = 52KCA3JZ59; | 868 | + DEVELOPMENT_TEAM = 4X46JG9W6V; |
877 | GENERATE_INFOPLIST_FILE = YES; | 869 | GENERATE_INFOPLIST_FILE = YES; |
878 | INFOPLIST_FILE = "InterQR-Internship/Info.plist"; | 870 | INFOPLIST_FILE = "InterQR-Internship/Info.plist"; |
879 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; | 871 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; |
@@ -902,7 +894,7 @@ | @@ -902,7 +894,7 @@ | ||
902 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; | 894 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; |
903 | CODE_SIGN_STYLE = Automatic; | 895 | CODE_SIGN_STYLE = Automatic; |
904 | CURRENT_PROJECT_VERSION = 1; | 896 | CURRENT_PROJECT_VERSION = 1; |
905 | - DEVELOPMENT_TEAM = 52KCA3JZ59; | 897 | + DEVELOPMENT_TEAM = 4X46JG9W6V; |
906 | GENERATE_INFOPLIST_FILE = YES; | 898 | GENERATE_INFOPLIST_FILE = YES; |
907 | INFOPLIST_FILE = "InterQR-Internship/Info.plist"; | 899 | INFOPLIST_FILE = "InterQR-Internship/Info.plist"; |
908 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; | 900 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; |
@@ -8,26 +8,29 @@ | @@ -8,26 +8,29 @@ | ||
8 | import Foundation | 8 | import Foundation |
9 | 9 | ||
10 | struct Constants { | 10 | struct Constants { |
11 | - enum APIRoutes { | ||
12 | - case initURL | ||
13 | - case startURL | ||
14 | - case verifyURL | ||
15 | - case loginURL | ||
16 | - case logoutURL | 11 | + static let baseURL = "https://www.interqr.com" |
12 | +} | ||
13 | + | ||
14 | +enum APIRoutes { | ||
15 | + case initURL | ||
16 | + case startURL | ||
17 | + case verifyURL | ||
18 | + case loginURL | ||
19 | + case logoutURL | ||
20 | + | ||
21 | + var urlString: String { | ||
22 | + switch self { | ||
17 | 23 | ||
18 | - var urlString: String { | ||
19 | - switch self { | ||
20 | - case .initURL: | ||
21 | - return "https://www.interqr.com/api/init" | ||
22 | - case .startURL: | ||
23 | - return "https://www.interqr.com/api/twofa/start" | ||
24 | - case .verifyURL: | ||
25 | - return "https://www.interqr.com/api/twofa/verify" | ||
26 | - case .loginURL: | ||
27 | - return "https://www.interqr.com/api/login" | ||
28 | - case .logoutURL: | ||
29 | - return "https://www.interqr.com/api/logout" | ||
30 | - } | 24 | + case .initURL: |
25 | + return "/api/init" | ||
26 | + case .startURL: | ||
27 | + return "/api/twofa/start" | ||
28 | + case .verifyURL: | ||
29 | + return "/api/twofa/verify" | ||
30 | + case .loginURL: | ||
31 | + return "/api/login" | ||
32 | + case .logoutURL: | ||
33 | + return "/api/logout" | ||
31 | } | 34 | } |
32 | } | 35 | } |
33 | } | 36 | } |
InterQR-Internship/Modules/OneTimePasswordScreen/ViewController/CodeVerificationViewController.swift
@@ -37,7 +37,7 @@ class CodeVerificationViewController: UIViewController { | @@ -37,7 +37,7 @@ class CodeVerificationViewController: UIViewController { | ||
37 | } | 37 | } |
38 | 38 | ||
39 | func networkingVerify() { | 39 | func networkingVerify() { |
40 | - guard let verifyUrl = URL(string: Constants.APIRoutes.verifyURL.urlString) else { return } | 40 | + guard let verifyUrl = URL(string: APIRoutes.verifyURL.urlString) else { return } |
41 | let verifyModel = verifyModelFilling() | 41 | let verifyModel = verifyModelFilling() |
42 | AuthNetworkManager.share.verifyRequest(verifyUrl, model: verifyModel!) { response in | 42 | AuthNetworkManager.share.verifyRequest(verifyUrl, model: verifyModel!) { response in |
43 | print("3️⃣✅\(response.data)") | 43 | print("3️⃣✅\(response.data)") |
@@ -50,7 +50,7 @@ class CodeVerificationViewController: UIViewController { | @@ -50,7 +50,7 @@ class CodeVerificationViewController: UIViewController { | ||
50 | } | 50 | } |
51 | 51 | ||
52 | func networkingLogin() { | 52 | func networkingLogin() { |
53 | - guard let loginUrl = URL(string: Constants.APIRoutes.loginURL.urlString) else { return } | 53 | + guard let loginUrl = URL(string: APIRoutes.loginURL.urlString) else { return } |
54 | guard let loginModel = loginModelFilling() else { return } | 54 | guard let loginModel = loginModelFilling() else { return } |
55 | 55 | ||
56 | self.networkManager.loginRequest(loginUrl, model: loginModel) { response in | 56 | self.networkManager.loginRequest(loginUrl, model: loginModel) { response in |
@@ -12,7 +12,6 @@ protocol ResidentTableViewCellDelegate: AnyObject { | @@ -12,7 +12,6 @@ protocol ResidentTableViewCellDelegate: AnyObject { | ||
12 | func didManagerButtonTapped(cell: ResidentTableViewCell) | 12 | func didManagerButtonTapped(cell: ResidentTableViewCell) |
13 | func didHiddenButtonTapped(cell: ResidentTableViewCell) | 13 | func didHiddenButtonTapped(cell: ResidentTableViewCell) |
14 | func didHeardButtonTapped(cell: ResidentTableViewCell) | 14 | func didHeardButtonTapped(cell: ResidentTableViewCell) |
15 | - | ||
16 | } | 15 | } |
17 | 16 | ||
18 | class ResidentTableViewCell: UITableViewCell { | 17 | class ResidentTableViewCell: UITableViewCell { |
@@ -89,7 +88,7 @@ class ResidentTableViewCell: UITableViewCell { | @@ -89,7 +88,7 @@ class ResidentTableViewCell: UITableViewCell { | ||
89 | }() | 88 | }() |
90 | 89 | ||
91 | var heartButton: UIButton = { | 90 | var heartButton: UIButton = { |
92 | - var obj = UIButton(type: .system) | 91 | + var obj = UIButton() |
93 | obj.setImage(UIImage(named: .Image.heart), for: .normal) | 92 | obj.setImage(UIImage(named: .Image.heart), for: .normal) |
94 | obj.setImage(UIImage(named: .Image.heartRed), for: .selected) | 93 | obj.setImage(UIImage(named: .Image.heartRed), for: .selected) |
95 | return obj | 94 | return obj |
@@ -184,6 +183,9 @@ class ResidentTableViewCell: UITableViewCell { | @@ -184,6 +183,9 @@ class ResidentTableViewCell: UITableViewCell { | ||
184 | } | 183 | } |
185 | 184 | ||
186 | removeCellButton.addTarget(self, action: #selector(didRemoveButtonTapped(_:)), for: .touchUpInside) | 185 | removeCellButton.addTarget(self, action: #selector(didRemoveButtonTapped(_:)), for: .touchUpInside) |
186 | + managerButton.addTarget(self, action: #selector(didButtonsTapped(_:)), for: .touchUpInside) | ||
187 | + hiddenButton.addTarget(self, action: #selector(didButtonsTapped(_:)), for: .touchUpInside) | ||
188 | + heartButton.addTarget(self, action: #selector(didButtonsTapped(_:)), for: .touchUpInside) | ||
187 | } | 189 | } |
188 | 190 | ||
189 | override func layoutSubviews() { | 191 | override func layoutSubviews() { |
@@ -198,4 +200,10 @@ extension ResidentTableViewCell { | @@ -198,4 +200,10 @@ extension ResidentTableViewCell { | ||
198 | @objc private func didRemoveButtonTapped(_ sender: UIButton) { | 200 | @objc private func didRemoveButtonTapped(_ sender: UIButton) { |
199 | delegate?.didRemoveButtonTapped(cell: self) | 201 | delegate?.didRemoveButtonTapped(cell: self) |
200 | } | 202 | } |
203 | + | ||
204 | + @objc private func didButtonsTapped(_ sender: UIButton) { | ||
205 | + delegate?.didManagerButtonTapped(cell: self) | ||
206 | + delegate?.didHiddenButtonTapped(cell: self) | ||
207 | + delegate?.didHeardButtonTapped(cell: self) | ||
208 | + } | ||
201 | } | 209 | } |
@@ -47,9 +47,9 @@ class ResidentsViewController: UIViewController { | @@ -47,9 +47,9 @@ class ResidentsViewController: UIViewController { | ||
47 | } | 47 | } |
48 | 48 | ||
49 | func networking() { | 49 | func networking() { |
50 | - guard let initUrl = URL(string: Constants.APIRoutes.initURL.urlString) else { return } | 50 | + guard let initUrl = URL(string: APIRoutes.initURL.urlString) else { return } |
51 | guard let model = modelFilling() else { return } | 51 | guard let model = modelFilling() else { return } |
52 | - networkManager.initRequest(initUrl, model: model) { responseModel in | 52 | + networkManager.initRequest(initUrl, completion: (InitResponseModel) -> Void, model: model) { responseModel in |
53 | print("1️⃣✅\(responseModel.message)✅") | 53 | print("1️⃣✅\(responseModel.message)✅") |
54 | } fail: { error in | 54 | } fail: { error in |
55 | print("1️⃣\(error)") | 55 | print("1️⃣\(error)") |
@@ -84,19 +84,19 @@ extension ResidentsViewController: UITableViewDelegate, UITableViewDataSource { | @@ -84,19 +84,19 @@ extension ResidentsViewController: UITableViewDelegate, UITableViewDataSource { | ||
84 | return cell | 84 | return cell |
85 | } | 85 | } |
86 | 86 | ||
87 | - @objc private func removeCell(_ sender: UIButton) { | ||
88 | - myData.remove(at: sender.tag) | ||
89 | - mainView.tableView.deleteRows(at: [IndexPath(row: sender.tag, section: 0)], with: .fade) | ||
90 | - mainView.tableView.reloadData() | ||
91 | - } | 87 | +// @objc private func removeCell(_ sender: UIButton) { |
88 | +// myData.remove(at: sender.tag) | ||
89 | +// mainView.tableView.deleteRows(at: [IndexPath(row: sender.tag, section: 0)], with: .fade) | ||
90 | +// mainView.tableView.reloadData() | ||
91 | +// } | ||
92 | 92 | ||
93 | - @objc private func didTapManagerButton(_ sender: UIButton) { | ||
94 | - if !sender.isSelected { | ||
95 | - sender.isSelected = true | ||
96 | - } else { | ||
97 | - sender.isSelected = false | ||
98 | - } | ||
99 | - } | 93 | +// @objc private func didTapManagerButton(_ sender: UIButton) { |
94 | +// if !sender.isSelected { | ||
95 | +// sender.isSelected = true | ||
96 | +// } else { | ||
97 | +// sender.isSelected = false | ||
98 | +// } | ||
99 | +// } | ||
100 | } | 100 | } |
101 | //MARK: - ResidentSavable delegate | 101 | //MARK: - ResidentSavable delegate |
102 | extension ResidentsViewController: ResidentSavable { | 102 | extension ResidentsViewController: ResidentSavable { |
@@ -116,17 +116,31 @@ extension ResidentsViewController: ResidentTableViewCellDelegate { | @@ -116,17 +116,31 @@ extension ResidentsViewController: ResidentTableViewCellDelegate { | ||
116 | mainView.tableView.reloadData() | 116 | mainView.tableView.reloadData() |
117 | } | 117 | } |
118 | 118 | ||
119 | + func didButtonsTapped(_ sender: UIButton) { | ||
120 | + | ||
121 | + } | ||
122 | + | ||
119 | func didManagerButtonTapped(cell: ResidentTableViewCell) { | 123 | func didManagerButtonTapped(cell: ResidentTableViewCell) { |
120 | - print("") | 124 | + if !cell.managerButton.isSelected { |
125 | + cell.managerButton.isSelected = true | ||
126 | + } else { | ||
127 | + cell.managerButton.isSelected = false | ||
128 | + } | ||
121 | } | 129 | } |
122 | 130 | ||
123 | func didHiddenButtonTapped(cell: ResidentTableViewCell) { | 131 | func didHiddenButtonTapped(cell: ResidentTableViewCell) { |
124 | - print("") | 132 | + if !cell.hiddenButton.isSelected { |
133 | + cell.hiddenButton.isSelected = true | ||
134 | + } else { | ||
135 | + cell.hiddenButton.isSelected = false | ||
136 | + } | ||
125 | } | 137 | } |
126 | 138 | ||
127 | func didHeardButtonTapped(cell: ResidentTableViewCell) { | 139 | func didHeardButtonTapped(cell: ResidentTableViewCell) { |
128 | - print("") | 140 | + if !cell.heartButton.isSelected { |
141 | + cell.heartButton.isSelected = true | ||
142 | + } else { | ||
143 | + cell.heartButton.isSelected = false | ||
144 | + } | ||
129 | } | 145 | } |
130 | - | ||
131 | - | ||
132 | } | 146 | } |
@@ -46,7 +46,7 @@ extension SettingsViewController { | @@ -46,7 +46,7 @@ extension SettingsViewController { | ||
46 | } | 46 | } |
47 | 47 | ||
48 | func networking() { | 48 | func networking() { |
49 | - guard let logoutUrl = URL(string: Constants.APIRoutes.logoutURL.urlString) else { return } | 49 | + guard let logoutUrl = URL(string: APIRoutes.logoutURL.urlString) else { return } |
50 | guard let logoutModel = logoutModelFilling() else { return } | 50 | guard let logoutModel = logoutModelFilling() else { return } |
51 | networkManager.logoutRequest(logoutUrl, model: logoutModel) { response in | 51 | networkManager.logoutRequest(logoutUrl, model: logoutModel) { response in |
52 | print("5️⃣❇️\(response.message ?? "Data not received!")❇️") | 52 | print("5️⃣❇️\(response.message ?? "Data not received!")❇️") |
@@ -52,7 +52,7 @@ class VerificationViewController: UIViewController { | @@ -52,7 +52,7 @@ class VerificationViewController: UIViewController { | ||
52 | } | 52 | } |
53 | 53 | ||
54 | func networking() { | 54 | func networking() { |
55 | - guard let startUrl = URL(string: Constants.APIRoutes.startURL.urlString) else { return } | 55 | + guard let startUrl = URL(string: APIRoutes.startURL.urlString) else { return } |
56 | guard let startModel = startModelFilling() else { return } | 56 | guard let startModel = startModelFilling() else { return } |
57 | networkManager.startRequest(startUrl, model: startModel) { response in | 57 | networkManager.startRequest(startUrl, model: startModel) { response in |
58 | print("2️⃣✅\(response.message)✅") | 58 | print("2️⃣✅\(response.message)✅") |
@@ -31,7 +31,7 @@ class AuthNetworkManager { | @@ -31,7 +31,7 @@ class AuthNetworkManager { | ||
31 | 31 | ||
32 | typealias FailedHandler = (Error) -> Void | 32 | typealias FailedHandler = (Error) -> Void |
33 | 33 | ||
34 | - func initRequest(_ url: URL, model: InitRequestModel, completion: @escaping InitWebServiceResponse, fail: @escaping FailedHandler) { | 34 | + func initRequest(_ model: InitRequestModel, completion: @escaping (InitResponseModel) -> Void, fail: @escaping FailedHandler) { |
35 | 35 | ||
36 | let params = ["device_uuid": model.deviceUUID, | 36 | let params = ["device_uuid": model.deviceUUID, |
37 | "manufacturer": model.manufacturer, | 37 | "manufacturer": model.manufacturer, |
@@ -40,7 +40,7 @@ class AuthNetworkManager { | @@ -40,7 +40,7 @@ class AuthNetworkManager { | ||
40 | "os_version": model.osVersion, | 40 | "os_version": model.osVersion, |
41 | "app_version": model.appVersion] as [String: Any] | 41 | "app_version": model.appVersion] as [String: Any] |
42 | 42 | ||
43 | - AF.request(url, method: .post, parameters: params, encoding: JSONEncoding.default).responseDecodable(of: InitResponseModel.self ) { response in | 43 | + AF.request(Constants.baseURL + APIRoutes.initURL.urlString, method: .post, parameters: params, encoding: JSONEncoding.default).responseDecodable(of: InitResponseModel.self ) { response in |
44 | 44 | ||
45 | if let error = response.error { | 45 | if let error = response.error { |
46 | fail(error) | 46 | fail(error) |
Please
register
or
login
to post a comment