Skip to content

Commit c7805c6

Browse files
chashmeetsinghmariobehling
authored andcommitted
Skill listing implementation (#220)
* display group names * added UI and displayed skills * fixes * improvements, fetch model lang and group * Fixes * Improvements * Fix tests, final changes * Fix: 503 error
1 parent 5da3f79 commit c7805c6

24 files changed

+691
-51
lines changed

Podfile.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ PODS:
2222
- ReachabilitySwift (3)
2323
- ReadabilityKit (0.6.1):
2424
- Ji (~> 2.0.1)
25-
- Realm (2.9.1):
26-
- Realm/Headers (= 2.9.1)
27-
- Realm/Headers (2.9.1)
28-
- RealmSwift (2.9.1):
29-
- Realm (= 2.9.1)
25+
- Realm (2.10.0):
26+
- Realm/Headers (= 2.10.0)
27+
- Realm/Headers (2.10.0)
28+
- RealmSwift (2.10.0):
29+
- Realm (= 2.10.0)
3030
- SnapKit (3.2.0)
3131
- SwiftDate (4.1.7)
3232
- SwiftValidators (6.0.0)
@@ -70,8 +70,8 @@ SPEC CHECKSUMS:
7070
NVActivityIndicatorView: d3738df7e2e476aca0ba6bf32a8c9fbcfc33d64b
7171
ReachabilitySwift: f5b9bb30a0777fac8f09ce8b067e32faeb29bb64
7272
ReadabilityKit: 49c26a2da9708ae3b355854d5bee6a7edee2dfee
73-
Realm: f91fb43bd474c4f731a116ebf7392c75dd015920
74-
RealmSwift: 207f12a4a36b696c5183c60a1c06d70234a23e56
73+
Realm: 98b3a25643cf6b3e07d2b99fb43fe0eb9c801dec
74+
RealmSwift: 34073ad3a31232bbaf7c0db898c037940284cba2
7575
SnapKit: 1ca44df72cfa543218d177cb8aab029d10d86ea7
7676
SwiftDate: 029be76691ee89176da3a46c7df3415b6734bc5b
7777
SwiftValidators: 4ccbec749f61a36f7a922781bb09452e80cde396

Susi.xcodeproj/project.pbxproj

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
/* Begin PBXBuildFile section */
1010
4CD0AA5F1EDF2CB700BC8FD5 /* ControllerConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CD0AA5E1EDF2CB700BC8FD5 /* ControllerConstants.swift */; };
1111
4FCDF8638A44821DEACBB4E0 /* Pods_Susi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 39326DEEDBD0CCA432D3B25D /* Pods_Susi.framework */; };
12+
6D017B251F4EAF86004BDE7E /* SkillListingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D017B241F4EAF86004BDE7E /* SkillListingViewController.swift */; };
13+
6D017B271F4EB641004BDE7E /* SkillListingVCMethods.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D017B261F4EB641004BDE7E /* SkillListingVCMethods.swift */; };
14+
6D017B291F4EC2D3004BDE7E /* SkillListingTableCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D017B281F4EC2D3004BDE7E /* SkillListingTableCell.swift */; };
15+
6D017B2B1F4EC941004BDE7E /* SkillListingCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D017B2A1F4EC941004BDE7E /* SkillListingCollectionView.swift */; };
16+
6D017B2E1F4ECA90004BDE7E /* SkillCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D017B2D1F4ECA90004BDE7E /* SkillCell.swift */; };
17+
6D017B301F4ED651004BDE7E /* Skill.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D017B2F1F4ED651004BDE7E /* Skill.swift */; };
1218
6D0B28DC1F3D55B100E273E1 /* ResetPasswordController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D0B28DB1F3D55B100E273E1 /* ResetPasswordController.swift */; };
1319
6D0B28DE1F3D873D00E273E1 /* ResetPasswordVCMethods.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D0B28DD1F3D873D00E273E1 /* ResetPasswordVCMethods.swift */; };
1420
6D0B28E01F3D8F6300E273E1 /* CustomTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D0B28DF1F3D8F6300E273E1 /* CustomTextField.swift */; };
@@ -95,6 +101,12 @@
95101
24F4C1EEBA4B8BDCFD043E65 /* Pods-SusiUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SusiUITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SusiUITests/Pods-SusiUITests.release.xcconfig"; sourceTree = "<group>"; };
96102
39326DEEDBD0CCA432D3B25D /* Pods_Susi.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Susi.framework; sourceTree = BUILT_PRODUCTS_DIR; };
97103
4CD0AA5E1EDF2CB700BC8FD5 /* ControllerConstants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ControllerConstants.swift; sourceTree = "<group>"; };
104+
6D017B241F4EAF86004BDE7E /* SkillListingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SkillListingViewController.swift; sourceTree = "<group>"; };
105+
6D017B261F4EB641004BDE7E /* SkillListingVCMethods.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SkillListingVCMethods.swift; sourceTree = "<group>"; };
106+
6D017B281F4EC2D3004BDE7E /* SkillListingTableCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SkillListingTableCell.swift; sourceTree = "<group>"; };
107+
6D017B2A1F4EC941004BDE7E /* SkillListingCollectionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SkillListingCollectionView.swift; sourceTree = "<group>"; };
108+
6D017B2D1F4ECA90004BDE7E /* SkillCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SkillCell.swift; sourceTree = "<group>"; };
109+
6D017B2F1F4ED651004BDE7E /* Skill.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Skill.swift; sourceTree = "<group>"; };
98110
6D0B28DB1F3D55B100E273E1 /* ResetPasswordController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResetPasswordController.swift; sourceTree = "<group>"; };
99111
6D0B28DD1F3D873D00E273E1 /* ResetPasswordVCMethods.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResetPasswordVCMethods.swift; sourceTree = "<group>"; };
100112
6D0B28DF1F3D8F6300E273E1 /* CustomTextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomTextField.swift; sourceTree = "<group>"; };
@@ -215,6 +227,27 @@
215227
name = Pods;
216228
sourceTree = "<group>";
217229
};
230+
6D017B231F4EAF64004BDE7E /* SkillListingViewController */ = {
231+
isa = PBXGroup;
232+
children = (
233+
6D017B261F4EB641004BDE7E /* SkillListingVCMethods.swift */,
234+
6D017B241F4EAF86004BDE7E /* SkillListingViewController.swift */,
235+
);
236+
name = SkillListingViewController;
237+
path = SkillListingViewController;
238+
sourceTree = "<group>";
239+
};
240+
6D017B2C1F4EC98E004BDE7E /* Skill Listing Cells */ = {
241+
isa = PBXGroup;
242+
children = (
243+
6D017B2D1F4ECA90004BDE7E /* SkillCell.swift */,
244+
6D017B2A1F4EC941004BDE7E /* SkillListingCollectionView.swift */,
245+
6D017B281F4EC2D3004BDE7E /* SkillListingTableCell.swift */,
246+
);
247+
name = "Skill Listing Cells";
248+
path = "Skill Listing Cells";
249+
sourceTree = "<group>";
250+
};
218251
6D0B28DA1F3D558300E273E1 /* ResetPasswordController */ = {
219252
isa = PBXGroup;
220253
children = (
@@ -281,9 +314,10 @@
281314
isa = PBXGroup;
282315
children = (
283316
6D3FB3471E8136640015E1D6 /* Message Cells */,
284-
6D87A32D1EEE54CC00A6D763 /* WebsearchCollectionView.swift */,
317+
6D017B2C1F4EC98E004BDE7E /* Skill Listing Cells */,
285318
6D0B28DF1F3D8F6300E273E1 /* CustomTextField.swift */,
286319
6D6F90471F4AF30800C84137 /* LongPressToCopyTextView.swift */,
320+
6D87A32D1EEE54CC00A6D763 /* WebsearchCollectionView.swift */,
287321
);
288322
path = "Custom Views";
289323
sourceTree = "<group>";
@@ -315,15 +349,15 @@
315349
isa = PBXGroup;
316350
children = (
317351
6D3DACC41F25FB9900CEFBC7 /* ActivityIndicatorCell.swift */,
352+
6DE0025A1F3FF93A0065DB85 /* AnchorCell.swift */,
318353
6D2F984A1E76DF2200FE2B6F /* BaseCell.swift */,
319354
6D3FB3481E813B900015E1D6 /* ChatMessageCell.swift */,
355+
6D7CE2E11F40255700C6353F /* ImageCell.swift */,
320356
6D0DB6271EE436FC00AD030D /* IncomingChatCell.swift */,
357+
6DE002581F3FF5140065DB85 /* MapCell.swift */,
321358
6D0DB6251EE4272300AD030D /* OutgoingChatCell.swift */,
322359
6D87A3311EEE86CC00A6D763 /* RSSCell.swift */,
323360
6D87A32F1EEE557000A6D763 /* WebsearchCell.swift */,
324-
6DE002581F3FF5140065DB85 /* MapCell.swift */,
325-
6DE0025A1F3FF93A0065DB85 /* AnchorCell.swift */,
326-
6D7CE2E11F40255700C6353F /* ImageCell.swift */,
327361
);
328362
path = "Message Cells";
329363
sourceTree = "<group>";
@@ -382,6 +416,7 @@
382416
6D0B28DA1F3D558300E273E1 /* ResetPasswordController */,
383417
6DEE71131F2CB03C00A512CF /* SettingsController */,
384418
6D24B0921EE409860097418A /* SignUpController */,
419+
6D017B231F4EAF64004BDE7E /* SkillListingViewController */,
385420
6DE809CD1F34DBFD00CAE674 /* TrainingViewController */,
386421
6DEE71111F2C9DC900A512CF /* AppNavigationController.swift */,
387422
);
@@ -424,6 +459,7 @@
424459
6D61B9B61EEBAB7000CD3536 /* MapAction.swift */,
425460
6D61B9AA1EEBAA3900CD3536 /* Message.swift */,
426461
6D61B9AE1EEBAAD700CD3536 /* RSSAction.swift */,
462+
6D017B2F1F4ED651004BDE7E /* Skill.swift */,
427463
6D61B9B21EEBAB4000CD3536 /* TableAction.swift */,
428464
6D9C0D281E7B223A00199828 /* User.swift */,
429465
6D61B9B01EEBAB0200CD3536 /* WebsearchAction.swift */,
@@ -759,7 +795,9 @@
759795
6D0B28E01F3D8F6300E273E1 /* CustomTextField.swift in Sources */,
760796
6D0DB6261EE4272300AD030D /* OutgoingChatCell.swift in Sources */,
761797
6D0DB6241EE41D1000AD030D /* ChatVCMethods.swift in Sources */,
798+
6D017B2E1F4ECA90004BDE7E /* SkillCell.swift in Sources */,
762799
6DE44E0F1E769AD300215B85 /* Color.swift in Sources */,
800+
6D017B251F4EAF86004BDE7E /* SkillListingViewController.swift in Sources */,
763801
6DEE71121F2C9DC900A512CF /* AppNavigationController.swift in Sources */,
764802
6DE0025B1F3FF93A0065DB85 /* AnchorCell.swift in Sources */,
765803
6D24B0961EE409DB0097418A /* SignUpVCMethods.swift in Sources */,
@@ -778,6 +816,7 @@
778816
6D61B9AD1EEBAAA200CD3536 /* AnswerAction.swift in Sources */,
779817
6D3E82461E7953B200D48776 /* SettingsViewController.swift in Sources */,
780818
6D61B9B71EEBAB7000CD3536 /* MapAction.swift in Sources */,
819+
6D017B301F4ED651004BDE7E /* Skill.swift in Sources */,
781820
6D4D9B3B1E768E190067459C /* AppDelegate.swift in Sources */,
782821
6D61B9B51EEBAB6000CD3536 /* AnchorAction.swift in Sources */,
783822
6D6F90481F4AF30800C84137 /* LongPressToCopyTextView.swift in Sources */,
@@ -786,6 +825,7 @@
786825
6D7CE2E21F40255700C6353F /* ImageCell.swift in Sources */,
787826
6DE44E1B1E76B5D600215B85 /* SignUpViewController.swift in Sources */,
788827
6D9C0D291E7B223A00199828 /* User.swift in Sources */,
828+
6D017B2B1F4EC941004BDE7E /* SkillListingCollectionView.swift in Sources */,
789829
6D24B0911EE4093C0097418A /* ForgotPasswordVCMethods.swift in Sources */,
790830
6D61B9B11EEBAB0200CD3536 /* WebsearchAction.swift in Sources */,
791831
6DE002591F3FF5140065DB85 /* MapCell.swift in Sources */,
@@ -800,7 +840,9 @@
800840
6D87A3321EEE86CC00A6D763 /* RSSCell.swift in Sources */,
801841
6D5DDFF61F3378D80078BB97 /* TrainingViewController.swift in Sources */,
802842
6DD5030E1F36656C008388E4 /* SpeechRecognitionDelegate.swift in Sources */,
843+
6D017B271F4EB641004BDE7E /* SkillListingVCMethods.swift in Sources */,
803844
6D24B08A1EE4079E0097418A /* LoginVCMethods.swift in Sources */,
845+
6D017B291F4EC2D3004BDE7E /* SkillListingTableCell.swift in Sources */,
804846
);
805847
runOnlyForDeploymentPostprocessing = 0;
806848
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "icon-Small.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "[email protected]",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"filename" : "[email protected]",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"version" : 1,
21+
"author" : "xcode"
22+
}
23+
}
4.51 KB
Loading
6.05 KB
Loading
7.77 KB
Loading

Susi/Controllers/ChatViewController/ChatVCMethods.swift

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,14 @@ extension ChatViewController {
6363
func setupNavbar() {
6464
navigationItem.title = ControllerConstants.susiTitle
6565
navigationItem.titleLabel.textAlignment = .left
66-
navigationItem.rightViews = [settingsButton]
6766
}
6867

6968
// setup view
7069
func setupView() {
7170
UIApplication.shared.statusBarStyle = .lightContent
72-
settingsButton.tintColor = .white
7371
navigationItem.titleLabel.textColor = .black
7472
UIApplication.shared.statusBarView?.backgroundColor = UIColor.defaultColor()
75-
settingsButton.backgroundColor = UIColor.defaultColor()
7673
view.backgroundColor = UIColor.chatBackgroundColor()
77-
7874
}
7975

8076
// setup send button
@@ -158,11 +154,11 @@ extension ChatViewController {
158154
messageInputContainerView.addConstraintsWithFormat(format: "V:|[v0(0.5)]", views: topBorderView)
159155
}
160156

161-
// setup settings button
162-
func addSettingsButton() {
163-
view.addSubview(settingsButton)
164-
view.addConstraintsWithFormat(format: "H:[v0(36)]-8-|", views: settingsButton)
165-
view.addConstraintsWithFormat(format: "V:|-28-[v0(36)]", views: settingsButton)
157+
// setup skill listing button
158+
func addSkillListingButton() {
159+
view.addSubview(susiSkillListingButton)
160+
view.addConstraintsWithFormat(format: "H:[v0(36)]-8-|", views: susiSkillListingButton)
161+
view.addConstraintsWithFormat(format: "V:|-28-[v0(36)]", views: susiSkillListingButton)
166162
}
167163

168164
// setup scroll button
@@ -290,10 +286,10 @@ extension ChatViewController {
290286
}
291287
}
292288

293-
// presents the settings controller
294-
func presentSettingsController() {
295-
let storyboard = UIStoryboard(name: "Main", bundle: nil)
296-
let vc = storyboard.instantiateViewController(withIdentifier: "SettingsController")
289+
// present skill listing controller
290+
func presentSkillListingController() {
291+
let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
292+
let vc = mainStoryboard.instantiateViewController(withIdentifier: "SkillListingController")
297293
let nvc = AppNavigationController(rootViewController: vc)
298294
present(nvc, animated: true, completion: nil)
299295
}

Susi/Controllers/ChatViewController/ChatViewController.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ class ChatViewController: UICollectionViewController {
1919

2020
// MARK: - Variable Declarations
2121

22-
// for opening settings view controller
23-
lazy var settingsButton: IconButton = {
22+
lazy var susiSkillListingButton: IconButton = {
2423
let ib = IconButton()
25-
ib.image = ControllerConstants.Images.settings
26-
ib.tintColor = .white
24+
ib.image = ControllerConstants.Images.susiSymbol
2725
ib.cornerRadius = 18.0
28-
ib.addTarget(self, action: #selector(presentSettingsController), for: .touchUpInside)
29-
ib.tintColor = .black
26+
ib.addTarget(self, action: #selector(presentSkillListingController), for: .touchUpInside)
27+
ib.backgroundColor = UIColor.defaultColor()
3028
return ib
3129
}()
3230

@@ -146,7 +144,7 @@ class ChatViewController: UICollectionViewController {
146144
addGestures()
147145
configureLocationManager()
148146
loadMessages()
149-
addSettingsButton()
147+
addSkillListingButton()
150148
addScrollButton()
151149
}
152150

Susi/Controllers/ChatViewController/CollectionViewDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ extension ChatViewController: UICollectionViewDelegateFlowLayout {
9898

9999
override func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
100100
UIView.animate(withDuration: 2.5, delay: 0, options: UIViewAnimationOptions(), animations: {
101-
self.settingsButton.isHidden = true
101+
self.susiSkillListingButton.isHidden = true
102102
}, completion: nil)
103103
}
104104

105105
override func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
106106
UIView.animate(withDuration: 2.5, delay: 0, options: UIViewAnimationOptions(), animations: {
107-
self.settingsButton.isHidden = false
107+
self.susiSkillListingButton.isHidden = false
108108
}, completion: nil)
109109
}
110110

Susi/Controllers/SettingsController/SettingsVCMethods.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ extension SettingsViewController {
4242
Client.sharedInstance.logoutUser { (success, error) in
4343
DispatchQueue.main.async {
4444
if success {
45-
self.presentingViewController?.presentingViewController?.dismiss(animated: true, completion: nil)
45+
self.presentingViewController?.presentingViewController?
46+
.presentingViewController?.dismiss(animated: true, completion: nil)
4647
} else {
4748
debugPrint(error)
4849
}
@@ -94,13 +95,15 @@ extension SettingsViewController {
9495
}
9596

9697
func presentTrainingController() {
97-
let vc = ControllerConstants.Controllers.trainingViewController
98+
let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
99+
let vc = mainStoryboard.instantiateViewController(withIdentifier: "TrainingViewController")
98100
let nvc = AppNavigationController(rootViewController: vc)
99101
present(nvc, animated: true, completion: nil)
100102
}
101103

102104
func presentResetPasswordController() {
103-
let vc = ControllerConstants.Controllers.resetPasswordViewController
105+
let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
106+
let vc = mainStoryboard.instantiateViewController(withIdentifier: "ResetPasswordController")
104107
let nvc = AppNavigationController(rootViewController: vc)
105108
present(nvc, animated: true, completion: nil)
106109
}

0 commit comments

Comments
 (0)