Skip to content

Commit 3036d81

Browse files
committed
Dismiss keyboard on swiping message list
1 parent 96ba720 commit 3036d81

Some content is hidden

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

53 files changed

+1734
-1838
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
### v2.0.6 (Jan 28, 2021)
4+
* Dismiss keyboard on swiping message list
5+
36
### v2.0.5 (Jan 20, 2021)
47
* Improved stability
58

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>2.0.5</string>
16+
<string>2.0.6</string>
1717
<key>CFBundleVersion</key>
1818
<string>1</string>
1919
</dict>
-479 KB
Binary file not shown.

SendBirdUIKit.framework/Assets.car

0 Bytes
Binary file not shown.

SendBirdUIKit.framework/Headers/SBUBaseChannelViewController.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ import UIKit
1010

1111
@objcMembers
1212
open class SBUBaseChannelViewController: UIViewController {
13-
open func setupAutolayout() {
14-
}
13+
open func setupAutolayout() {}
1514

16-
open func setupStyles() {
17-
}
15+
open func setupStyles() {}
1816

19-
open func updateStyles() {
17+
open func updateStyles() {}
18+
}
19+
20+
extension SBUBaseChannelViewController: UIGestureRecognizerDelegate {
21+
open func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer,
22+
shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer)
23+
-> Bool {
24+
return true
2025
}
2126
}

SendBirdUIKit.framework/Headers/SBUChannelViewController.swift

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ open class SBUChannelViewController: SBUBaseChannelViewController, UINavigationC
246246
self.tableView.alwaysBounceVertical = false
247247
self.tableView.separatorStyle = .none
248248
self.tableView.allowsSelection = false
249-
249+
250250
if self.adminMessageCell == nil {
251251
self.register(adminMessageCell: SBUAdminMessageCell())
252252
}
@@ -2191,7 +2191,14 @@ open class SBUChannelViewController: SBUBaseChannelViewController, UINavigationC
21912191
/// This function dismisses the keyboard.
21922192
/// - Since: 1.2.5
21932193
public func dismissKeyboard() {
2194-
view.endEditing(true)
2194+
self.view.endEditing(true)
2195+
}
2196+
2197+
@objc private func dismissKeyboardIfTouchInput(gestureRecognizer: UIPanGestureRecognizer) {
2198+
let point = gestureRecognizer.location(in: view)
2199+
if self.messageInputView.frame.contains(point) {
2200+
self.view.endEditing(true)
2201+
}
21952202
}
21962203

21972204
/// This functions adds the hide keyboard gesture in tableView.
@@ -2200,6 +2207,10 @@ open class SBUChannelViewController: SBUBaseChannelViewController, UINavigationC
22002207
let tap = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))
22012208
tap.cancelsTouchesInView = false
22022209
tableView.addGestureRecognizer(tap)
2210+
2211+
let pan = UIPanGestureRecognizer(target: self, action: #selector(dismissKeyboardIfTouchInput))
2212+
pan.cancelsTouchesInView = false
2213+
tableView.addGestureRecognizer(pan)
22032214
}
22042215

22052216

0 commit comments

Comments
 (0)