Skip to content

Commit 87f663a

Browse files
pushpsenairekar2911pushpsenairekar2911
authored andcommitted
v2.1.8
1 parent 8c35f39 commit 87f663a

File tree

73 files changed

+4870
-3062
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+4870
-3062
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ assignees: ''
1010

1111

1212

13-
1413
**Describe the bug**
1514
A clear and concise description of what the bug is.
1615

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ ios-objective-c-chat-app/.DS_Store
88

99

1010

11+

CometChatObjc/CometChatObjc.xcodeproj/project.pbxproj

Lines changed: 2022 additions & 1982 deletions
Large diffs are not rendered by default.

CometChatObjc/CometChatObjc/Library/Resources/Extensioon/MessageActions.swift

Lines changed: 77 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
case thread
2525
case share
2626
case sticker
27+
case reaction
2728
}
2829

2930
protocol RowPresentable {
@@ -46,6 +47,7 @@
4647
func didSharePressed()
4748
func didForwardPressed()
4849
func didStickerPressed()
50+
func didReactionPressed()
4951
}
5052

5153

@@ -87,6 +89,9 @@
8789
}
8890
let actionsCell = UINib.init(nibName: "ActionsCell", bundle: UIKitSettings.bundle)
8991
self.tableView.register(actionsCell, forCellReuseIdentifier: "actionsCell")
92+
93+
let addReactionCell = UINib.init(nibName: "AddReactionsCell", bundle: UIKitSettings.bundle)
94+
self.tableView.register(addReactionCell, forCellReuseIdentifier: "addReactionsCell")
9095
}
9196

9297
// MARK: - UITableViewDataSource
@@ -96,33 +101,44 @@
96101
}
97102

98103
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
99-
100-
guard let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell
101-
else { return UITableViewCell() }
102-
104+
105+
let staticCell = UITableViewCell()
103106
if let currentActions = actions {
104107
switch currentActions[indexPath.row] {
105108
case .takeAPhoto:
109+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
106110
cell.name.text = "Take a Photo"
107111
cell.icon.image = UIImage(named: "􀌞.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
108112
cell.fullScreenSwitch.isHidden = true
109113
cell.badgeCountSwitch.isHidden = true
114+
return cell
115+
}
110116
case .photoAndVideoLibrary:
117+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
111118
cell.name.text = "Photo & Video Library"
112119
cell.icon.image = UIImage(named: "􀣵.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
113120
cell.fullScreenSwitch.isHidden = true
114121
cell.badgeCountSwitch.isHidden = true
122+
return cell
123+
}
115124
case .document:
125+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
116126
cell.name.text = "Document"
117127
cell.icon.image = UIImage(named: "􀈕.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
118128
cell.fullScreenSwitch.isHidden = true
119129
cell.badgeCountSwitch.isHidden = true
130+
return cell
131+
}
120132
case .shareLocation:
133+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
121134
cell.name.text = "Share Location"
122135
cell.icon.image = UIImage(named: "􀋑.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
123136
cell.fullScreenSwitch.isHidden = true
124137
cell.badgeCountSwitch.isHidden = true
138+
return cell
139+
}
125140
case .edit:
141+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
126142
cell.name.text = "Edit Message"
127143
if #available(iOS 13.0, *) {
128144
cell.name.textColor = .label
@@ -132,7 +148,10 @@
132148
cell.icon.image = UIImage(named: "􀈎.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
133149
cell.fullScreenSwitch.isHidden = true
134150
cell.badgeCountSwitch.isHidden = true
151+
return cell
152+
}
135153
case .delete:
154+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
136155
cell.name.text = "Delete Message"
137156
if #available(iOS 13.0, *) {
138157
cell.name.textColor = .label
@@ -143,27 +162,45 @@
143162
cell.icon.tintColor = #colorLiteral(red: 0.9254902005, green: 0.2352941185, blue: 0.1019607857, alpha: 1)
144163
cell.fullScreenSwitch.isHidden = true
145164
cell.badgeCountSwitch.isHidden = true
165+
return cell
166+
}
146167
case .reply:
168+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
147169
cell.name.text = "Reply Message"
170+
cell.icon.image = UIImage(named: "reply1.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
148171
if #available(iOS 13.0, *) {
172+
cell.icon.tintColor = .label
149173
cell.name.textColor = .label
150174
}else{
175+
cell.icon.tintColor = .black
151176
cell.name.textColor = .black
152177
}
153-
cell.icon.image = UIImage(named: "􀉌.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
154178
cell.fullScreenSwitch.isHidden = true
155179
cell.badgeCountSwitch.isHidden = true
180+
return cell
181+
}
156182
case .forward:
183+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
157184
cell.name.text = "Forward Message"
158185
if #available(iOS 13.0, *) {
159186
cell.name.textColor = .label
160187
}else{
161188
cell.name.textColor = .black
162189
}
163190
cell.icon.image = UIImage(named: "􀉐.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
191+
if #available(iOS 13.0, *) {
192+
cell.icon.tintColor = .label
193+
cell.name.textColor = .label
194+
}else{
195+
cell.icon.tintColor = .black
196+
cell.name.textColor = .black
197+
}
164198
cell.fullScreenSwitch.isHidden = true
165199
cell.badgeCountSwitch.isHidden = true
200+
return cell
201+
}
166202
case .thread:
203+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
167204
cell.name.text = "Start Thread"
168205
cell.icon.image = UIImage(named: "􀌤.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
169206
if #available(iOS 13.0, *) {
@@ -173,8 +210,10 @@
173210
}
174211
cell.fullScreenSwitch.isHidden = true
175212
cell.badgeCountSwitch.isHidden = true
176-
213+
return cell
214+
}
177215
case .share:
216+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
178217
cell.icon.image = UIImage(named: "􀈂.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
179218
cell.name.text = "Share Message"
180219
if #available(iOS 13.0, *) {
@@ -184,7 +223,10 @@
184223
}
185224
cell.fullScreenSwitch.isHidden = true
186225
cell.badgeCountSwitch.isHidden = true
226+
return cell
227+
}
187228
case .messageInfo:
229+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
188230
cell.icon.image = UIImage(named: "􀅴.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
189231
cell.name.text = "Message Information"
190232
if #available(iOS 13.0, *) {
@@ -194,28 +236,51 @@
194236
}
195237
cell.fullScreenSwitch.isHidden = true
196238
cell.badgeCountSwitch.isHidden = true
239+
return cell
240+
}
197241
case .copy:
242+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
198243
cell.name.text = "Copy Message"
199244
cell.icon.image = UIImage(named: "􀉁.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
200245
cell.fullScreenSwitch.isHidden = true
201246
cell.badgeCountSwitch.isHidden = true
247+
return cell
248+
}
202249
case .createAPoll:
250+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
203251
cell.name.text = "Create a Poll"
204252
cell.icon.image = UIImage(named: "􀌶.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
205253
cell.fullScreenSwitch.isHidden = true
206254
cell.badgeCountSwitch.isHidden = true
255+
return cell
256+
}
207257
case .sticker:
258+
if let cell = tableView.dequeueReusableCell(withIdentifier: "actionsCell", for: indexPath) as? ActionsCell {
208259
cell.name.text = "Send Sticker"
209260
cell.icon.image = UIImage(named: "sticker1.png", in: UIKitSettings.bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
210261
cell.fullScreenSwitch.isHidden = true
211262
cell.badgeCountSwitch.isHidden = true
263+
return cell
264+
}
265+
case .reaction:
266+
if let cell = tableView.dequeueReusableCell(withIdentifier: "addReactionsCell", for: indexPath) as? AddReactionsCell {
267+
return cell
268+
}
212269
}
213270
}
214-
return cell
271+
return staticCell
215272
}
216273

217274
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
218-
return 55.0
275+
if UIKitSettings.messageReaction == .enabled {
276+
if indexPath.row == 0 {
277+
return 65.0
278+
}else{
279+
return 55.0
280+
}
281+
}else{
282+
return 55.0
283+
}
219284
}
220285

221286
// MARK: - UITableViewDelegate
@@ -283,6 +348,10 @@
283348
self.dismiss(animated: true) {
284349
MessageActions.actionsDelegate?.didStickerPressed()
285350
}
351+
case .reaction:
352+
self.dismiss(animated: true) {
353+
MessageActions.actionsDelegate?.didReactionPressed()
354+
}
286355
}
287356
}
288357
}

CometChatObjc/CometChatObjc/Library/Resources/Extensioon/PanModalPresentable+Defaults.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import UIKit
3232
}
3333

3434
var cornerRadius: CGFloat {
35-
return 8.0
35+
return 15.0
3636
}
3737

3838
var springDamping: CGFloat {
Binary file not shown.
1.46 KB
Loading
2.33 KB
Loading

0 commit comments

Comments
 (0)