Skip to content

Commit

Permalink
Updated to version 2.1.0.
Browse files Browse the repository at this point in the history
 - Added Message Search features.
 - Deprecated lastSeenAt feature.
 - Changes in SBUIconSet
 - Changes in SBUColorSet
 - Changes in SBUFontSet
 - Improved stability.
  • Loading branch information
hoon-sung committed Mar 24, 2021
1 parent 7a8e8c4 commit 1ff546a
Show file tree
Hide file tree
Showing 83 changed files with 8,933 additions and 3,590 deletions.
86 changes: 84 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,91 @@
# Change Log

### v2.0.9 (March 9, 2021)
### v2.1.0 (Mar 24, 2021)
* Added Message Search features.
* Added `SBUMessageSearchViewController` and `SBUHighlightMessageInfo` classes.
* Added `SBUChannelViewController(channelUrl:startingPoint:messageListParams:)`
* Added `startingPoint`, `highlightInfo`, `useRightBarButtonItem` properties in `SBUChannelViewController`.
* Added `SBUAvailable.isSupportMessageSearch()`.
* Deprecated lastSeenAt feature.
* Changes in SBUIconSet
* Added
* iconBan
* iconBroadcast
* iconCheckboxChecked
* iconCheckboxUnchecked
* iconChevronRight
* iconDone
* iconDoneAll
* iconEmojiMore
* iconNotificationFilled
* iconNotificationOffFilled
* iconQuestion
* iconSpinner
* iconThumbnailNone
* Replaced
* channelTypeBroadcast -> iconBroadcast
* channelTypeGroup -> iconChat
* channelTypeSupergroup -> iconSupergroup
* emojiFail -> iconQuestion
* emojiMoreLarge -> iconEmojiMore
* iconActionLeave -> iconLeave
* iconActionNotificationOff -> iconNotificationOffFilled
* iconActionNotificationOn -> iconNotificationFilled
* iconAvatarLight -> iconUser
* iconBanned -> iconBan
* iconBroadcastSmall -> iconBroadcast
* iconBroadcastMedium -> iconBroadcast
* iconBroadcastLarge -> iconBroadcast
* iconCheckbox -> iconCheckboxChecked
* iconCheckboxOff -> iconCheckboxUnchecked
* iconDelivered -> iconDoneAll
* iconErrorFilled -> iconError
* iconFailed -> iconError
* iconMuted -> iconMute
* iconNoThumbnailLight -> iconThumbnailNone
* iconRead -> iconDoneAll
* iconSent -> iconDone
* iconShevronRight -> iconChevronRight
* iconSpinnerLarge -> iconSpinner
* iconSpinnerSmall -> iconSpinner
* iconThumbnailLight -> iconPhoto
* Removed
* emojiHeartEyes
* emojiLaughing
* emojiRage
* emojiSob
* emojiSweatSmile
* emojiThubsdown
* emojiThumbsup
* iconChatHide
* iconChatShow
* iconCreate
* iconDummy
* Changes in SBUColorSet
* Changed `primary*` colors.
* Changed `secondary*` colors.
* Changed `background300` color.
* Changed `background200` color.
* Changed `background100` color.
* Added `background50`.
* Added `error*` colors.
* Removed `error` (replaced with `error300`)
* Changes in SBUFontSet
* Changed weight of `h1`.
* Changed size and weight of `h2`.
* Changed size of `h3`.
* Changed size of `body1`.
* Changed weight of `body2`.
* Changed weight of `body3`.
* Changed size of `button1`.
* Changed weight of `caption3`.
* Changed weight of `caption4`.
* Improved stability.

### v2.0.9 (Mar 9, 2021)
* Fixed runtime debugger issue.

### v2.0.8 (March 2, 2021)
### v2.0.8 (Mar 2, 2021)
* Changes in `SBUChannelViewController` and `SBUOpenChannelViewController`
* Set `keyboardDismissMode` of `tableView` to `.interactive` as default.
* Changed `messageInputViewBottomConstraint`, `tableViewTopConstraint` properties to private access.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The minimum requirements for Sendbird UIKit for iOS are:

- iOS 10.3+
- Swift 4.2+ / Objective-C
- Sendbird Chat SDK for iOS 3.0.200+
- Sendbird Chat SDK for iOS 3.0.216+

<br />

Expand All @@ -73,7 +73,7 @@ You can get started by creating a project. Sendbird UIKit supports both `Objecti

UIKit for iOS can be installed through either [`CocoaPods`](https://cocoapods.org/) or [`Carthage`](https://github.com/Carthage/Carthage):

> Note: Sendbird UIKit for iOS is Sendbird Chat SDK-dependent. If you install the UIKit, `CocoaPods` will automatically install the Chat SDK for iOS as well. The minimum requirement of the Chat SDK for iOS is 3.0.200 or higher.
> Note: Sendbird UIKit for iOS is Sendbird Chat SDK-dependent. If you install the UIKit, `CocoaPods` will automatically install the Chat SDK for iOS as well. The minimum requirement of the Chat SDK for iOS is 3.0.216 or higher.

#### - CocoaPods
Expand Down Expand Up @@ -103,7 +103,7 @@ $ pod update
1. Add `SendBirdUIKit` and `SendBirdSDK` into your `Cartfile` as below:
```bash
github "sendbird/sendbird-uikit-ios"
github "sendbird/sendbird-ios-framework" == 3.0.205
github "sendbird/sendbird-ios-framework" == 3.0.216
```
2. Install the `SendBirdUIKit` framework through `Carthage`.
```bash
Expand Down
2 changes: 1 addition & 1 deletion SendBirdUIKit.framework.dSYM/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>2.0.9</string>
<string>2.1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
Binary file not shown.
Binary file modified SendBirdUIKit.framework/Assets.car
Binary file not shown.
33 changes: 28 additions & 5 deletions SendBirdUIKit.framework/Headers/SBUActionSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ public typealias SBUActionSheetHandler = () -> Void
public class SBUActionSheetItem: SBUCommonItem {
var completionHandler: SBUActionSheetHandler?

public override init(title: String? = nil,
color: UIColor? = SBUColorSet.onlight01,
image: UIImage? = nil,
font: UIFont? = nil,
tintColor: UIColor? = nil,
textAlignment: NSTextAlignment = .left) {
super.init(title: title,
color: color,
image: image,
font: font,
tintColor: tintColor,
textAlignment: textAlignment)
self.completionHandler = nil
}

/// This function initializes actionSheet item.
/// - Parameters:
/// - title: Title text
Expand Down Expand Up @@ -52,6 +67,14 @@ public class SBUActionSheet: NSObject {
weak var delegate: SBUActionSheetDelegate?
private var items: [SBUActionSheetItem] = []

private var safeAreaInset: UIEdgeInsets {
if #available(iOS 11.0, *) {
return self.window?.safeAreaInsets ?? .zero
} else {
return .zero
}
}

var identifier: Int = -1
var window: UIWindow? = nil
var baseView = UIView()
Expand Down Expand Up @@ -143,9 +166,9 @@ public class SBUActionSheet: NSObject {

// Set items
let totalHeight = CGFloat(items.count + 1) * itemHeight + sideMargin + bottomMargin
let itemWidth = window.frame.width - (sideMargin * 2)
let itemWidth = window.frame.width - (sideMargin * 2) - (self.safeAreaInset.left + self.safeAreaInset.right)
self.baseView.frame = CGRect(
origin: CGPoint(x: sideMargin, y: window.frame.height - totalHeight),
origin: CGPoint(x: sideMargin + self.safeAreaInset.left, y: window.frame.height - totalHeight),
size: CGSize(width: itemWidth, height: totalHeight)
)

Expand Down Expand Up @@ -218,7 +241,7 @@ public class SBUActionSheet: NSObject {
isBottom: Bool) -> UIButton {

let width:CGFloat = (self.window?.bounds.width ?? self.baseView.frame.width)
let itemWidth: CGFloat = width - (self.sideMargin * 2)
let itemWidth: CGFloat = width - (self.sideMargin * 2) - (self.safeAreaInset.left + self.safeAreaInset.right)
let itemButton = UIButton(
frame: CGRect(
origin: .zero,
Expand Down Expand Up @@ -260,7 +283,7 @@ public class SBUActionSheet: NSObject {
)
titleLabel.text = item.title
titleLabel.font = item.font ?? theme.actionSheetTextFont
titleLabel.textColor = item.color ?? theme.titleColor
titleLabel.textColor = item.color ?? theme.actionSheetTextColor
titleLabel.textAlignment = item.textAlignment

itemButton.addSubview(titleLabel)
Expand Down Expand Up @@ -299,7 +322,7 @@ public class SBUActionSheet: NSObject {

private func makeCancelItem(item: SBUActionSheetItem) -> UIButton {
let width:CGFloat = (self.window?.bounds.width ?? self.baseView.frame.width)
let itemWidth: CGFloat = width - (self.sideMargin*2)
let itemWidth: CGFloat = width - (self.sideMargin * 2) - (self.safeAreaInset.left + self.safeAreaInset.right)
let itemButton = UIButton(
frame: CGRect(
origin: .zero,
Expand Down
2 changes: 1 addition & 1 deletion SendBirdUIKit.framework/Headers/SBUAdminMessageCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ open class SBUAdminMessageCell: SBUBaseMessageCell {
}

// MARK: - Common
public func configure(_ message: SBDAdminMessage, hideDateView: Bool) {
open func configure(_ message: SBDAdminMessage, hideDateView: Bool) {
super.configure(message: message,
position: .center,
hideDateView: hideDateView,
Expand Down
14 changes: 12 additions & 2 deletions SendBirdUIKit.framework/Headers/SBUAvailable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ public class SBUAvailable: NSObject {
static let ALLOW_GROUP_CHANNEL_UPDATE_FROM_SDK = "allow_group_channel_update_from_sdk"
static let ALLOW_ONLY_OPERATOR_SDK_TO_UPDATE_GROUP_CHANNEL = "allow_only_operator_sdk_to_update_group_channel"
static let ALLOW_BROADCAST_CHANNEL = "allow_broadcast_channel"
static let MESSAGE_SEARCH = "message_search_v3"

private static func isAvailable(key: String) -> Bool {
guard let appInfo = SBDMain.getAppInfo(),
let applicationAttributes = appInfo.applicationAttributes else { return false }
let applicationAttributes = appInfo.applicationAttributes,
let premiumFeatureList = appInfo.premiumFeatureList else { return false }

return applicationAttributes.contains(key)
return applicationAttributes.contains(key) ||
premiumFeatureList.contains(key)
}


Expand Down Expand Up @@ -63,4 +66,11 @@ public class SBUAvailable: NSObject {
public static func isSupportOgTag() -> Bool {
return self.isAvailable(key: ENABLE_OG_TAG)
}

/// This method checks if the application support message search.
/// - Returns: `true` if the message search can be used, `false` otherwise.
/// - Since: 2.1.0
public static func isSupportMessageSearch() -> Bool {
return self.isAvailable(key: MESSAGE_SEARCH)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,7 @@ import UIKit
```
*/
@objcMembers
open class SBUBaseChannelListViewController: UIViewController {
open func setupAutolayout() {
}

open func setupStyles() {
}

open func updateStyles() {
}
open class SBUBaseChannelListViewController: SBUBaseViewController {

/// This is a function that shows the channelViewController.
///
Expand Down
44 changes: 39 additions & 5 deletions SendBirdUIKit.framework/Headers/SBUBaseChannelViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import UIKit

@objcMembers
open class SBUBaseChannelViewController: UIViewController {
open class SBUBaseChannelViewController: SBUBaseViewController {

// MARK: - Properties (View)

Expand Down Expand Up @@ -40,7 +40,6 @@ open class SBUBaseChannelViewController: UIViewController {

open override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.setNeedsStatusBarAppearanceUpdate()

NotificationCenter.default.addObserver(
self,
Expand Down Expand Up @@ -80,25 +79,42 @@ open class SBUBaseChannelViewController: UIViewController {
self.tableView.separatorStyle = .none
self.tableView.allowsSelection = false
self.tableView.keyboardDismissMode = .interactive
self.tableView.bounces = false
self.tableView.alwaysBounceVertical = false
}

open func setupAutolayout() {}

open func setupStyles() {}
// MARK: - Styles

open func updateStyles() {
open override func updateStyles() {
if let userProfileView = self.userProfileView as? SBUUserProfileView {
userProfileView.setupStyles()
}
}

func setupScrollBottomViewStyle(scrollBottomView: UIView, theme: SBUComponentTheme = SBUTheme.componentTheme) {
view.layer.shadowColor = theme.shadowColor.withAlphaComponent(0.5).cgColor

guard let scrollBottomButton = scrollBottomView.subviews.first as? UIButton else { return }

scrollBottomButton.layer.cornerRadius = scrollBottomButton.frame.height / 2
scrollBottomButton.clipsToBounds = true

scrollBottomButton.setImage(SBUIconSetType.iconChevronDown.image(with: theme.scrollBottomButtonIconColor,
to: SBUIconSetType.Metric.iconChevronDown),
for: .normal)
scrollBottomButton.backgroundColor = theme.scrollBottomButtonBackground
scrollBottomButton.setBackgroundImage(UIImage.from(color: theme.scrollBottomButtonHighlighted), for: .highlighted)
}

/// This function sets the user profile tap gesture handling.
///
/// If you do not want to use the user profile function, override this function and leave it empty.
/// - Parameter user: `SBUUser` object used for user profile configuration
///
/// - Since: 1.2.2
open func setUserProfileTapGestureHandler(_ user: SBUUser) {
self.dismissKeyboard()
if let userProfileView = self.userProfileView as? SBUUserProfileView,
let baseView = self.navigationController?.view,
SBUGlobals.UsingUserProfile
Expand Down Expand Up @@ -236,6 +252,24 @@ open class SBUBaseChannelViewController: UIViewController {
pan.cancelsTouchesInView = false
tableView.addGestureRecognizer(pan)
}

// MARK: - Channel

public func loadChannel(channelUrl: String?, messageListParams: SBDMessageListParams? = nil) {}

func isScrollNearBottom() -> Bool {
return self.tableView.contentOffset.y < 10
}


// MARK: - Common

/// This is used to check the loading status and control loading indicator.
/// - Parameters:
/// - loadingState: Set to true when the list is loading.
/// - showIndicator: If true, the loading indicator is started, and if false, the indicator is stopped.
public func setLoading(_ loadingState: Bool, _ showIndicator: Bool) {}

}

extension SBUBaseChannelViewController: UIGestureRecognizerDelegate {
Expand Down
19 changes: 10 additions & 9 deletions SendBirdUIKit.framework/Headers/SBUChannelCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,17 @@ public class SBUChannelCell: SBUBaseChannelCell {
self.unreadCount.setTitleColor(theme.unreadCountTextColor, for: .normal)
self.unreadCount.titleLabel?.font = theme.unreadCountFont

self.broadcastIcon.image = SBUIconSet.iconBroadcastSmall.sbu_with(
tintColor: theme.broadcastMarkTintColor
self.broadcastIcon.image = SBUIconSetType.iconBroadcast.image(
with: theme.broadcastMarkTintColor,
to: SBUIconSetType.Metric.defaultIconSize
)

self.freezeState.image = SBUIconSet.iconFreeze.sbu_with(
tintColor: theme.freezeStateTintColor
self.freezeState.image = SBUIconSetType.iconFreeze.image(
with: theme.freezeStateTintColor,
to: SBUIconSetType.Metric.defaultIconSize
)

self.notificationState.image = SBUIconSet.iconMute.sbu_with(
tintColor: theme.messageTextColor
self.notificationState.image = SBUIconSetType.iconNotificationOffFilled.image(
with: theme.messageTextColor,
to: SBUIconSetType.Metric.defaultIconSize
)

self.separatorLine.backgroundColor = theme.separatorLineColor
Expand All @@ -189,7 +190,7 @@ public class SBUChannelCell: SBUBaseChannelCell {
/// This function configure a cell using `SBDGroupChannel` information.
/// - Note: If you use `SBDOpenChannel`, your cell class must inherit `SBUBaseChannelCell` and override `configure(channel:)` method.
/// - Parameter channel: `SBDGroupChannel` object
public override func configure(channel: SBDBaseChannel) {
open override func configure(channel: SBDBaseChannel) {
super.configure(channel: channel)

guard let channel = channel as? SBDGroupChannel else { return }
Expand Down
Loading

0 comments on commit 1ff546a

Please sign in to comment.