mvcgen 0.1.20 → 0.1.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -15
- data/lib/mvcgen/generator.rb +61 -1
- data/lib/mvcgen/version.rb +1 -1
- data/lib/templates/default/swift/Controllers/Login/ForgetPasswordVC.swift +32 -39
- data/lib/templates/default/swift/Controllers/Login/LoginVC.swift +21 -11
- data/lib/templates/default/swift/Controllers/Login/RegisterVC.swift +69 -59
- data/lib/templates/default/swift/Controllers/Notifications/Cells/NotificationCell.swift +28 -1
- data/lib/templates/default/swift/Controllers/Notifications/NotificationsVC.swift +17 -27
- data/lib/templates/default/swift/Controllers/OtherLogin/ForgetPasswordTVC.swift +9 -10
- data/lib/templates/default/swift/Controllers/OtherLogin/LoginTVC.swift +1 -1
- data/lib/templates/default/swift/Controllers/OtherLogin/OtherRegisterVC.swift +11 -10
- data/lib/templates/default/swift/Controllers/OtherLogin/SelectLanguageVC.swift +22 -21
- data/lib/templates/default/swift/Controllers/OtherLogin/TermsAndConditionsVC.swift +8 -7
- data/lib/templates/default/swift/Controllers/Profile/AboutUsVC.swift +23 -11
- data/lib/templates/default/swift/Controllers/Profile/Cells/AboutUsImageCell.swift +21 -5
- data/lib/templates/default/swift/Controllers/Profile/Cells/DescriptionCell.swift +10 -0
- data/lib/templates/default/swift/Controllers/Profile/Cells/DestinationCell.swift +5 -0
- data/lib/templates/default/swift/Controllers/Profile/Cells/FavoriteCollectionCell.swift +2 -0
- data/lib/templates/default/swift/Controllers/Profile/Cells/ImagesCollectionViewCell.swift +12 -0
- data/lib/templates/default/swift/Controllers/Profile/ProfileContainerVC.swift +18 -14
- data/lib/templates/default/swift/Controllers/Profile/ProfileTVC.swift +65 -85
- data/lib/templates/default/swift/Controllers/Tutorial/TutorialVC.swift +12 -9
- data/lib/templates/default/swift/Extensions/Buttons.swift +0 -12
- data/lib/templates/default/swift/Extensions/{ArrayDuplicates.swift → Utils+Array.swift} +1 -1
- data/lib/templates/default/swift/Extensions/{Images.swift → Utils+Images.swift} +8 -7
- data/lib/templates/default/swift/Extensions/Utils+String.swift +34 -0
- data/lib/templates/default/swift/Extensions/Utils+UIButton.swift +21 -0
- data/lib/templates/default/swift/Extensions/{UIColorExtensions.swift → Utils+UIColor.swift} +1 -1
- data/lib/templates/default/swift/Extensions/{TableViewEmptyView.swift → Utils+UITableView.swift} +1 -2
- data/lib/templates/default/swift/Extensions/Utils+UITextField.swift +22 -0
- data/lib/templates/default/swift/Extensions/{GradientView.swift → Utils+UIView.swift} +82 -2
- data/lib/templates/default/swift/Extensions/{TapEffectExtension.swift → Utils+UIViewController.swift} +18 -1
- data/lib/templates/default/swift/Helper/Utils.swift +1 -1
- data/lib/templates/default/swift/UI/Storyboards/Home.storyboard +4 -4
- data/lib/templates/default/swift/UI/Views/EmptyTableView/Xibs/EmptyTableLabelView.xib +1 -1
- metadata +11 -18
- data/lib/templates/default/swift/Assets.xcassets/alert_beach.imageset/Contents.json +0 -21
- data/lib/templates/default/swift/Assets.xcassets/alert_beach.imageset/icons8-beach-64.png +0 -0
- data/lib/templates/default/swift/Assets.xcassets/alert_nobaggage.imageset/Contents.json +0 -21
- data/lib/templates/default/swift/Assets.xcassets/alert_nobaggage.imageset/icons8-no-baggage-100.png +0 -0
- data/lib/templates/default/swift/Assets.xcassets/alert_signpost.imageset/Contents.json +0 -21
- data/lib/templates/default/swift/Assets.xcassets/alert_signpost.imageset/icons8-signpost-64.png +0 -0
- data/lib/templates/default/swift/Assets.xcassets/alert_sunbed.imageset/Contents.json +0 -21
- data/lib/templates/default/swift/Assets.xcassets/alert_sunbed.imageset/sunbed.png +0 -0
- data/lib/templates/default/swift/Extensions/HideKeyboard.swift +0 -22
- data/lib/templates/default/swift/Extensions/InnerShadowExtension.swift +0 -83
@@ -7,9 +7,12 @@
|
|
7
7
|
//
|
8
8
|
|
9
9
|
import UIKit
|
10
|
+
import SwiftDate
|
10
11
|
|
11
12
|
class NotificationCell: UITableViewCell {
|
12
13
|
|
14
|
+
// MARK: - Outlets
|
15
|
+
|
13
16
|
@IBOutlet weak var notificationImage: UIImageView!{
|
14
17
|
didSet{
|
15
18
|
self.notificationImage.layoutIfNeeded()
|
@@ -32,6 +35,8 @@ class NotificationCell: UITableViewCell {
|
|
32
35
|
}
|
33
36
|
}
|
34
37
|
|
38
|
+
// MARK: - Life cycle
|
39
|
+
|
35
40
|
override func awakeFromNib() {
|
36
41
|
super.awakeFromNib()
|
37
42
|
// Initialization code
|
@@ -43,9 +48,31 @@ class NotificationCell: UITableViewCell {
|
|
43
48
|
override func prepareForReuse() {
|
44
49
|
super.prepareForReuse()
|
45
50
|
|
46
|
-
self.notificationImage.image =
|
51
|
+
self.notificationImage.image = Asset.tick.notifications
|
47
52
|
|
48
53
|
self.newNotificationView.isHidden = true
|
49
54
|
}
|
55
|
+
|
56
|
+
func configure(with notification: Notif) {
|
57
|
+
|
58
|
+
self.notificationText.text = notification.body
|
59
|
+
|
60
|
+
self.newNotificationView.isHidden = notification.read
|
61
|
+
|
62
|
+
let region = Region.Local()
|
63
|
+
let dateB = DateInRegion(absoluteDate: notification.createdDate as Date, in: region)
|
64
|
+
let (colloquial, _) = try! dateB.colloquialSinceNow()
|
65
|
+
self.notificationDate.text = colloquial
|
66
|
+
|
67
|
+
// In case you need to config something by notif type:
|
68
|
+
// switch notification.notifType{
|
69
|
+
// case .broadcast:
|
70
|
+
// break
|
71
|
+
// case .generic:
|
72
|
+
// break
|
73
|
+
// default:
|
74
|
+
// break
|
75
|
+
// }
|
76
|
+
}
|
50
77
|
|
51
78
|
}
|
@@ -7,7 +7,6 @@
|
|
7
7
|
//
|
8
8
|
|
9
9
|
import UIKit
|
10
|
-
import SwiftDate
|
11
10
|
import Kingfisher
|
12
11
|
import PMAlertController
|
13
12
|
|
@@ -23,7 +22,7 @@ class NotificationsVC: UIViewController, UITableViewDelegate, UITableViewDataSou
|
|
23
22
|
|
24
23
|
// MARK: - Properties
|
25
24
|
|
26
|
-
let homeStoryboard = UIStoryboard(name: "Home", bundle: Bundle.main)
|
25
|
+
private static let homeStoryboard = UIStoryboard(name: "Home", bundle: Bundle.main)
|
27
26
|
|
28
27
|
var notifications = [Notif]()
|
29
28
|
|
@@ -31,17 +30,20 @@ class NotificationsVC: UIViewController, UITableViewDelegate, UITableViewDataSou
|
|
31
30
|
|
32
31
|
var delegate: NotificationReadProtocol?
|
33
32
|
|
33
|
+
// MARK: - Life cycle
|
34
|
+
|
34
35
|
override func viewDidLoad() {
|
35
36
|
super.viewDidLoad()
|
36
37
|
|
37
38
|
setup()
|
38
|
-
|
39
39
|
}
|
40
40
|
|
41
41
|
override func viewWillAppear(_ animated: Bool) {
|
42
42
|
super.viewWillAppear(true)
|
43
43
|
|
44
44
|
self.navigationController?.navigationBar.isHidden = true
|
45
|
+
|
46
|
+
// To avoid multi tap on cell
|
45
47
|
self.tableView.isUserInteractionEnabled = true
|
46
48
|
|
47
49
|
self.tableView.reloadData()
|
@@ -57,20 +59,20 @@ class NotificationsVC: UIViewController, UITableViewDelegate, UITableViewDataSou
|
|
57
59
|
|
58
60
|
self.tableView.rowHeight = UITableViewAutomaticDimension
|
59
61
|
|
60
|
-
let
|
61
|
-
let tintedImage = origImage?.withRenderingMode(.alwaysTemplate)
|
62
|
+
let tintedImage = Asset.back.image.withRenderingMode(.alwaysTemplate)
|
62
63
|
self.backButton.setImage(tintedImage, for: .normal)
|
63
64
|
self.backButton.tintColor = UIColor(red: 107.0/255.0, green: 255.0/255.0, blue: 192.0/255.0, alpha: 1)
|
64
65
|
}
|
65
66
|
|
66
|
-
|
67
|
-
|
68
67
|
@IBAction func backTapped(_ sender: UIButton) {
|
68
|
+
|
69
69
|
self.navigationController?.popViewController(animated: true)
|
70
70
|
}
|
71
|
+
|
71
72
|
override func viewWillDisappear(_ animated: Bool) {
|
72
73
|
super.viewWillDisappear(animated)
|
73
74
|
|
75
|
+
// Mark all notifications as read
|
74
76
|
if self.isMovingFromParentViewController{
|
75
77
|
delegate?.setAsRead(value: true)
|
76
78
|
}
|
@@ -79,10 +81,12 @@ class NotificationsVC: UIViewController, UITableViewDelegate, UITableViewDataSou
|
|
79
81
|
// MARK: - Table view
|
80
82
|
|
81
83
|
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
84
|
+
|
82
85
|
return notifications.count
|
83
86
|
}
|
84
87
|
|
85
88
|
func numberOfSections(in tableView: UITableView) -> Int {
|
89
|
+
|
86
90
|
if notifications.count > 0 {
|
87
91
|
self.hideNoNotificationsView()
|
88
92
|
return 1
|
@@ -93,6 +97,7 @@ class NotificationsVC: UIViewController, UITableViewDelegate, UITableViewDataSou
|
|
93
97
|
}
|
94
98
|
|
95
99
|
func setNoNotificationsView(){
|
100
|
+
|
96
101
|
let emptyTableLabelViewNib = UINib(nibName: "NoNotificationsView", bundle: nil)
|
97
102
|
let emptyTableLabelView = emptyTableLabelViewNib.instantiate(withOwner: nil, options: nil)[0] as! NoNotificationView
|
98
103
|
emptyTableLabelView.tag = 100
|
@@ -101,6 +106,7 @@ class NotificationsVC: UIViewController, UITableViewDelegate, UITableViewDataSou
|
|
101
106
|
}
|
102
107
|
|
103
108
|
func hideNoNotificationsView(){
|
109
|
+
|
104
110
|
self.tableView.separatorStyle = .singleLine
|
105
111
|
if let viewWithTag = self.tableView.viewWithTag(100) {
|
106
112
|
viewWithTag.isHidden = true
|
@@ -113,33 +119,17 @@ class NotificationsVC: UIViewController, UITableViewDelegate, UITableViewDataSou
|
|
113
119
|
|
114
120
|
let notification = self.notifications[indexPath.row]
|
115
121
|
|
116
|
-
cell.
|
117
|
-
|
118
|
-
if !notification.read{
|
119
|
-
cell.newNotificationView.isHidden = false
|
120
|
-
}
|
122
|
+
cell.configure(with: notification)
|
121
123
|
|
122
|
-
let region = Region.Local()
|
123
|
-
let dateB = DateInRegion(absoluteDate: notification.createdDate as Date, in: region)
|
124
|
-
let (colloquial, _) = try! dateB.colloquialSinceNow()
|
125
|
-
cell.notificationDate.text = colloquial
|
126
|
-
switch notification.notifType{
|
127
|
-
case .broadcast:
|
128
|
-
break
|
129
|
-
case .generic:
|
130
|
-
break
|
131
|
-
default:
|
132
|
-
break
|
133
|
-
}
|
134
124
|
return cell
|
135
125
|
}
|
136
126
|
|
137
127
|
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
128
|
+
|
129
|
+
// To avoid multi tap on cell
|
138
130
|
self.tableView.isUserInteractionEnabled = false
|
139
131
|
|
140
|
-
|
141
|
-
|
142
|
-
self.selectedNotification = selectedNotif
|
132
|
+
self.selectedNotification = self.notifications[indexPath.row]
|
143
133
|
|
144
134
|
switch selectedNotif.notifType {
|
145
135
|
case .broadcast:
|
@@ -34,9 +34,7 @@ class ForgetPasswordTVC: UITableViewController, UITextFieldDelegate {
|
|
34
34
|
|
35
35
|
self.emailTextField.underlined(color: UIColor.white, width: 1.0)
|
36
36
|
self.emailTextField.addLeftIcon("envelope")
|
37
|
-
|
38
|
-
self.instructionsLabel.addCharacterSpacing(space: 0.9)
|
39
|
-
self.instructionsLabel.addLineSpacing(lineHeightMultiple: 1.4)
|
37
|
+
|
40
38
|
self.instructionsLabel.textAlignment = NSTextAlignment.center
|
41
39
|
|
42
40
|
self.emailTextField.delegate = self
|
@@ -44,7 +42,7 @@ class ForgetPasswordTVC: UITableViewController, UITextFieldDelegate {
|
|
44
42
|
|
45
43
|
override func viewDidLayoutSubviews() {
|
46
44
|
super.viewDidLayoutSubviews()
|
47
|
-
self.backgroundGradientView.applyGradient(withColours: [
|
45
|
+
self.backgroundGradientView.applyGradient(withColours: [Colors.firstGradientColor, Colors.secondGradientColor, Colors.thirdGradientColor], locations: [0, 0.2, 0.98])
|
48
46
|
}
|
49
47
|
|
50
48
|
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
@@ -81,12 +79,13 @@ class ForgetPasswordTVC: UITableViewController, UITextFieldDelegate {
|
|
81
79
|
private func forgetPasswordTapped(){
|
82
80
|
if let email = self.emailTextField.text, isValidEmail(email){
|
83
81
|
self.sendLinkButton.showLoading()
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
82
|
+
// TODO:
|
83
|
+
// RemoteUserRepository.sharedInstance.forgetPassword(email: email) { result in
|
84
|
+
// self.sendLinkButton.hideLoading()
|
85
|
+
// if result == .success{
|
86
|
+
// APIHelper.sharedInstance.showSuccesMessage(with: NSLocalizedString("Email sent!", comment: ""), and: "")
|
87
|
+
// }
|
88
|
+
// }
|
90
89
|
} else {
|
91
90
|
APIHelper.sharedInstance.showErrorMessage(with: NSLocalizedString("Invalid email", comment: ""), and: "")
|
92
91
|
}
|
@@ -10,7 +10,7 @@ import UIKit
|
|
10
10
|
import Pastel
|
11
11
|
import FacebookLogin
|
12
12
|
|
13
|
-
class
|
13
|
+
class LoginTVC: UITableViewController, UITextFieldDelegate, ForgetPasswordVCDelegate {
|
14
14
|
|
15
15
|
// MARK: - Outlets
|
16
16
|
|
@@ -59,7 +59,7 @@ class OtherRegisterVC: UITableViewController, UITextFieldDelegate {
|
|
59
59
|
self.registerButton.layoutIfNeeded()
|
60
60
|
self.registerButton.layer.cornerRadius = self.registerButton.frame.height/7
|
61
61
|
self.registerButton.layer.masksToBounds = true
|
62
|
-
self.registerButton.activityIndicatorColor =
|
62
|
+
self.registerButton.activityIndicatorColor = Colors.firstGradientColor
|
63
63
|
|
64
64
|
emailTextField.underlined(color: UIColor.white, width: 1.0)
|
65
65
|
nameTextField.underlined(color: UIColor.white, width: 1.0)
|
@@ -85,17 +85,18 @@ class OtherRegisterVC: UITableViewController, UITextFieldDelegate {
|
|
85
85
|
}
|
86
86
|
|
87
87
|
func fetchCountries(){
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
88
|
+
// TODO
|
89
|
+
// RemoteUserRepository.sharedInstance.getCountries() {
|
90
|
+
// result, countries in
|
91
|
+
// if result == .success {
|
92
|
+
// self.countries = countries
|
93
|
+
// }
|
94
|
+
// }
|
94
95
|
}
|
95
96
|
|
96
97
|
override func viewDidLayoutSubviews() {
|
97
98
|
super.viewDidLayoutSubviews()
|
98
|
-
self.gradientView.applyGradient(withColours: [
|
99
|
+
self.gradientView.applyGradient(withColours: [Colors.firstGradientColor, Colors.secondGradientColor, Colors.thirdGradientColor], locations: [0, 0.2, 0.98])
|
99
100
|
}
|
100
101
|
|
101
102
|
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
@@ -286,10 +287,10 @@ class OtherRegisterVC: UITableViewController, UITextFieldDelegate {
|
|
286
287
|
return
|
287
288
|
}, origin: sender)
|
288
289
|
|
289
|
-
acp?.setTextColor(
|
290
|
+
acp?.setTextColor(Colors.firstGradientColor)
|
290
291
|
acp?.pickerBackgroundColor = UIColor.white
|
291
292
|
acp?.toolbarBackgroundColor = UIColor.white
|
292
|
-
acp?.toolbarButtonsColor =
|
293
|
+
acp?.toolbarButtonsColor = Colors.firstGradientColor
|
293
294
|
acp?.show()
|
294
295
|
}
|
295
296
|
|
@@ -41,32 +41,33 @@ class SelectLanguageVC: UITableViewController {
|
|
41
41
|
override func viewDidLayoutSubviews() {
|
42
42
|
super.viewDidLayoutSubviews()
|
43
43
|
|
44
|
-
self.gradientView.applyGradient(withColours: [
|
44
|
+
self.gradientView.applyGradient(withColours: [Colors.firstGradientColor, Colors.secondGradientColor, Colors.thirdGradientColor], locations: [0, 0.2, 0.98])
|
45
45
|
}
|
46
46
|
|
47
47
|
@IBAction func registerTapped(_ sender: UIButton) {
|
48
48
|
if selectedLanguages.count > 0 {
|
49
49
|
if let email = self.signupInfo["email"], let firstname = self.signupInfo["firstname"], let lastname = self.signupInfo["lastname"], let phoneCountry = self.signupInfo["phoneCountry"], let phone = self.signupInfo["phone"], let password = self.signupInfo["password"]{
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
50
|
+
// TODO:
|
51
|
+
// UserRepository.sharedInstance.signup(
|
52
|
+
// email: email,
|
53
|
+
// password: password,
|
54
|
+
// name: firstname,
|
55
|
+
// lastname: lastname,
|
56
|
+
// phoneCountry: phoneCountry,
|
57
|
+
// phone: phone,
|
58
|
+
// languages: selectedLanguages
|
59
|
+
// ) { result, message in
|
60
|
+
//
|
61
|
+
// if result == .success {
|
62
|
+
// self.performSegue(withIdentifier: "ShowHome", sender: self)
|
63
|
+
// } else {
|
64
|
+
// if let msg = message {
|
65
|
+
// APIHelper.sharedInstance.showErrorMessage(with: msg, and: "")
|
66
|
+
// } else {
|
67
|
+
// APIHelper.sharedInstance.showErrorMessage(with: NSLocalizedString("Connection error with services.", comment: ""), and: "")
|
68
|
+
// }
|
69
|
+
// }
|
70
|
+
// }
|
70
71
|
}
|
71
72
|
}
|
72
73
|
else{
|
@@ -14,7 +14,7 @@ class TermsAndConditionsVC: UIViewController {
|
|
14
14
|
didSet{
|
15
15
|
self.registerButtonOutlet.layer.cornerRadius = self.registerButtonOutlet.frame.height/7
|
16
16
|
self.registerButtonOutlet.layer.masksToBounds = true
|
17
|
-
self.registerButtonOutlet.activityIndicatorColor =
|
17
|
+
self.registerButtonOutlet.activityIndicatorColor = Colors.firstGradientColor
|
18
18
|
}
|
19
19
|
}
|
20
20
|
@IBOutlet weak var termsAndConditions: UIButton!{
|
@@ -28,7 +28,7 @@ class TermsAndConditionsVC: UIViewController {
|
|
28
28
|
|
29
29
|
override func viewDidLoad() {
|
30
30
|
super.viewDidLoad()
|
31
|
-
self.view.applyGradient(withColours: [
|
31
|
+
self.view.applyGradient(withColours: [Colors.firstGradientColor, Colors.secondGradientColor, Colors.thirdGradientColor], locations: [0, 0.2, 0.98])
|
32
32
|
// Do any additional setup after loading the view.
|
33
33
|
}
|
34
34
|
|
@@ -59,11 +59,11 @@ class TermsAndConditionsVC: UIViewController {
|
|
59
59
|
|
60
60
|
@IBAction func registerTapped(_ sender: Any) {
|
61
61
|
if self.acceptTermsAndConditions{
|
62
|
-
UserRepository.sharedInstance.acceptTermsAndConditions(){ result in
|
63
|
-
if result == .success{
|
64
|
-
self.performSegue(withIdentifier: "registerToHome", sender: self)
|
65
|
-
}
|
66
|
-
}
|
62
|
+
// UserRepository.sharedInstance.acceptTermsAndConditions(){ result in
|
63
|
+
// if result == .success{
|
64
|
+
// self.performSegue(withIdentifier: "registerToHome", sender: self)
|
65
|
+
// }
|
66
|
+
// }
|
67
67
|
} else {
|
68
68
|
APIHelper.sharedInstance.showErrorMessage(with: NSLocalizedString("You have to accept terms & conditions", comment: ""), and: "")
|
69
69
|
}
|
@@ -74,3 +74,4 @@ class TermsAndConditionsVC: UIViewController {
|
|
74
74
|
}
|
75
75
|
|
76
76
|
}
|
77
|
+
|
@@ -9,6 +9,7 @@
|
|
9
9
|
import UIKit
|
10
10
|
|
11
11
|
// TODO: Temp picture struct
|
12
|
+
|
12
13
|
struct Pic{
|
13
14
|
|
14
15
|
var url = ""
|
@@ -32,7 +33,8 @@ class AboutUsVC: UIViewController, UITableViewDelegate, UITableViewDataSource{
|
|
32
33
|
// MARK: - Properties
|
33
34
|
|
34
35
|
var pictures = [Pic]()
|
35
|
-
|
36
|
+
|
37
|
+
// MARK: - Life cycle
|
36
38
|
|
37
39
|
override func viewDidLoad() {
|
38
40
|
super.viewDidLoad()
|
@@ -40,7 +42,7 @@ class AboutUsVC: UIViewController, UITableViewDelegate, UITableViewDataSource{
|
|
40
42
|
setup()
|
41
43
|
|
42
44
|
// TODO: Add some pictures
|
43
|
-
self.pictures.append(Pic(url: "
|
45
|
+
self.pictures.append(Pic(url: ""))
|
44
46
|
}
|
45
47
|
|
46
48
|
override func viewWillAppear(_ animated: Bool) {
|
@@ -49,33 +51,43 @@ class AboutUsVC: UIViewController, UITableViewDelegate, UITableViewDataSource{
|
|
49
51
|
self.navigationController?.navigationItem.hidesBackButton = true
|
50
52
|
|
51
53
|
}
|
52
|
-
|
54
|
+
|
55
|
+
override func viewDidLayoutSubviews() {
|
56
|
+
view.backgroundColor = UIColor.clear
|
53
57
|
|
54
58
|
self.gradientView.applyGradient(withColours: [Colors.firstGradientColor, Colors.thirdGradientColor], locations: [0, 0.5])
|
55
|
-
|
56
|
-
self.tableView.rowHeight = UITableViewAutomaticDimension
|
57
|
-
|
58
|
-
let origImage = UIImage(named: "Back")
|
59
|
-
let tintedImage = origImage?.withRenderingMode(.alwaysTemplate)
|
60
|
-
self.backButton.setImage(tintedImage, for: .normal)
|
61
|
-
self.backButton.tintColor = UIColor(red: 107.0/255.0, green: 255.0/255.0, blue: 192.0/255.0, alpha: 1)
|
62
59
|
}
|
63
60
|
|
61
|
+
// MARK: - Actions
|
62
|
+
|
64
63
|
@IBAction func backTapped(_ sender: UIButton) {
|
65
64
|
self.navigationController?.popViewController(animated: true)
|
66
65
|
}
|
67
|
-
|
66
|
+
|
67
|
+
// MARK: - Private
|
68
|
+
|
69
|
+
private func setup() {
|
70
|
+
|
71
|
+
self.tableView.rowHeight = UITableViewAutomaticDimension
|
72
|
+
let tintedImage = Asset.back.image.withRenderingMode(.alwaysTemplate)
|
73
|
+
self.backButton.setImage(tintedImage, for: .normal)
|
74
|
+
self.backButton.tintColor = UIColor(red: 107.0/255.0, green: 255.0/255.0, blue: 192.0/255.0, alpha: 1)
|
75
|
+
}
|
76
|
+
|
68
77
|
// MARK: - Table view
|
69
78
|
|
70
79
|
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
80
|
+
|
71
81
|
return 1
|
72
82
|
}
|
73
83
|
|
74
84
|
func numberOfSections(in tableView: UITableView) -> Int {
|
85
|
+
|
75
86
|
return 2
|
76
87
|
}
|
77
88
|
|
78
89
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
90
|
+
|
79
91
|
switch indexPath.section{
|
80
92
|
case 0:
|
81
93
|
let cell = tableView.dequeueReusableCell(withIdentifier: "aboutUsImageCell", for: indexPath) as! AboutUsImageCell
|