Skip to content

Commit 43b2e72

Browse files
committed
* Supported - Reaction feature
* Added classes * `SBUReactionsViewController` * `SBUMessageReactionView` * `SBUReactionCollectionViewCell` * `SBUEmojiManager` * Added methods * `setReaction(message:emojiKey:didSelect:)` in `SBUChannelViewController` class * `setTapEmojiGestureHandler(cell:emojiKey:)` in `SBUChannelViewController` class * `setLongTapEmojiGestureHandler(cell:emojiKey:)` in `SBUChannelViewController` class * `showEmojiListModal(message:)` in `SBUChannelViewController` class
1 parent f13e171 commit 43b2e72

File tree

63 files changed

+1411
-289
lines changed

Some content is hidden

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

63 files changed

+1411
-289
lines changed

CHANGELOG.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
# Change Log
22

3-
### v1.0.11 (Jun 25, 2020)
3+
### v1.0.12 (July 10, 2020)
4+
* Supported - Reaction feature
5+
* Added classes
6+
* `SBUReactionsViewController`
7+
* `SBUMessageReactionView`
8+
* `SBUReactionCollectionViewCell`
9+
* `SBUEmojiManager`
10+
* Added methods
11+
* `setReaction(message:emojiKey:didSelect:)` in `SBUChannelViewController` class
12+
* `setTapEmojiGestureHandler(cell:emojiKey:)` in `SBUChannelViewController` class
13+
* `setLongTapEmojiGestureHandler(cell:emojiKey:)` in `SBUChannelViewController` class
14+
* `showEmojiListModal(message:)` in `SBUChannelViewController` class
15+
16+
### v1.0.11 (June 25, 2020)
417
* Supported - Custom `SBDChanngeListQuery` in the initialization function of `SBUChannelListViewController`
518
* Supported - Custom `SBDMessageListParams` in the initialization function of `SBUChannelViewController`
619
* Added - Unknown type message
720

8-
### v1.0.10 (Jun 18, 2020)
21+
### v1.0.10 (June 18, 2020)
922
* Fixed - Incorrect operator check logic in frozen group channel
1023

11-
### v1.0.9 (Jun 8, 2020)
24+
### v1.0.9 (June 8, 2020)
1225
* Supported - customized params, Changed access control
1326
* **`SBUChannelViewController`**
1427
* `channel`, `messageList`, `resendableMessages` properties

SendBirdUIKit.framework.dSYM/Contents/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundleSignature</key>
1414
<string>????</string>
1515
<key>CFBundleShortVersionString</key>
16-
<string>1.0.11</string>
16+
<string>1.0.12</string>
1717
<key>CFBundleVersion</key>
1818
<string>1</string>
1919
</dict>
2.93 MB
Binary file not shown.

SendBirdUIKit.framework/Assets.car

206 KB
Binary file not shown.

SendBirdUIKit.framework/Headers/SBUBaseMessageCell.swift

Lines changed: 72 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ open class SBUBaseMessageCell: UITableViewCell {
2424
}()
2525

2626
public lazy var dateView: UIView = MessageDateView()
27-
2827

2928
// MARK: - Private
3029
var theme: SBUMessageCellTheme = SBUTheme.messageCellTheme
@@ -69,7 +68,8 @@ open class SBUBaseMessageCell: UITableViewCell {
6968
/// This function handles the initialization of autolayouts.
7069
open func setupAutolayout() {
7170
self.stackView
72-
.setConstraint(from: self.contentView, left: 0, right: 0, top: 16, bottom: 0)
71+
.setConstraint(from: self.contentView, left: 0, top: 16, bottom: 0)
72+
.setConstraint(from: self.contentView, right: 0, priority: .defaultHigh)
7373
}
7474

7575
/// This function handles the initialization of styles.
@@ -112,6 +112,9 @@ open class SBUBaseMessageCell: UITableViewCell {
112112
var tapHandlerToProfileImage: (() -> Void)? = nil
113113
var tapHandlerToContent: (() -> Void)? = nil
114114
var longPressHandlerToContent: (() -> Void)? = nil
115+
var emojiTapHandler: ((_ emojiKey: String) -> Void)? = nil
116+
var moreEmojiTapHandler: (() -> Void)? = nil
117+
var emojiLongPressHandler: ((_ emojiKey: String) -> Void)? = nil
115118
}
116119

117120

@@ -213,12 +216,9 @@ public class MessageProfileView: UIView {
213216
}
214217

215218
func setupAutolayout() {
216-
let width = leftSpace + imageSize + rightSpace
217-
self.setConstraint(width: width, height: imageSize)
218-
219219
self.imageView
220220
.setConstraint(width: imageSize, height: imageSize)
221-
.setConstraint(from: self, centerX: true, centerY: true)
221+
.setConstraint(from: self, left: leftSpace, right: rightSpace, top: 0, bottom: 0)
222222
}
223223

224224
func setupStyles() {
@@ -288,19 +288,15 @@ public class UserNameView: UIView {
288288
self.backgroundColor = .clear
289289

290290
self.button.titleLabel?.font = theme.userNameFont
291+
self.button.contentHorizontalAlignment = .left
291292
self.button.setTitleColor(theme.userNameTextColor, for: .normal)
292293
}
293-
294-
public override func layoutSubviews() {
295-
super.layoutSubviews()
296-
297-
self.setupStyles()
298-
}
299-
294+
300295
func configure(username: String) {
301296
self.username = username
302297
self.button.setTitle(username, for: .normal)
303298
self.button.sizeToFit()
299+
self.setupStyles()
304300
self.setNeedsLayout()
305301
}
306302
}
@@ -444,3 +440,66 @@ public class MessageStateView: UIView {
444440
self.updateConstraints()
445441
}
446442
}
443+
444+
class MessageDetailContainerView: UIView {
445+
446+
var isSelected: Bool = false
447+
var position: MessagePosition = .left
448+
449+
let stackView: UIStackView = {
450+
let stackView = UIStackView()
451+
stackView.axis = .vertical
452+
return stackView
453+
}()
454+
455+
override init(frame: CGRect) {
456+
super.init(frame: frame)
457+
self.setupViews()
458+
self.setupAutolayout()
459+
self.setupStyles()
460+
}
461+
462+
@available(*, unavailable, renamed: "MessageContentDetailView()")
463+
required init?(coder: NSCoder) {
464+
super.init(coder: coder)
465+
}
466+
467+
func setupViews() {
468+
self.addSubview(self.stackView)
469+
}
470+
471+
func setupAutolayout() {
472+
self.stackView.setConstraint(from: self, left: 0, right: 0, top: 0, bottom: 0)
473+
}
474+
475+
func setupStyles() {
476+
self.layer.cornerRadius = 16
477+
self.layer.borderColor = UIColor.clear.cgColor
478+
self.layer.borderWidth = 1
479+
self.clipsToBounds = true
480+
self.setBackgroundColor()
481+
}
482+
483+
func setBackgroundColor() {
484+
485+
let theme = SBUTheme.messageCellTheme
486+
487+
switch self.position {
488+
case .left:
489+
self.backgroundColor = self.isSelected ? theme.leftPressedBackgroundColor : theme.leftBackgroundColor
490+
case .right:
491+
self.backgroundColor = self.isSelected ? theme.rightPressedBackgroundColor : theme.rightBackgroundColor
492+
case .center:
493+
break
494+
}
495+
496+
}
497+
498+
func configure(position: MessagePosition, isSelected: Bool) {
499+
self.position = position
500+
self.isSelected = isSelected
501+
502+
self.setBackgroundColor()
503+
self.setNeedsLayout()
504+
}
505+
}

0 commit comments

Comments
 (0)