Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/3.30.1 -> main #159

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

### v3.30.1 (Mar 20, 2025)

# SendbirdUIKit
## Improvements
- Added support for new delegate methods in `UITextViewDelegate` for iOS 17.0 or above

# SendbirdUIMessageTemplate
## Improvements
- Improved loading performance for background image view
- Fixed rendering issue with carousel padding.
- Size specification is now optional.

### v3.30.0 (Feb 27, 2025)

## Improvements
Expand Down
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ let package = Package(
targets: [
.binaryTarget(
name: "SendbirdUIKit",
url: "https://github.com/sendbird/sendbird-uikit-ios/releases/download/3.30.0/SendbirdUIKit.xcframework.zip", // SendbirdUIKit_URL
checksum: "b6c87631c28690713a9260e0fea87b820801f6f65645573e66e806f697ac6ea3" // SendbirdUIKit_CHECKSUM
url: "https://github.com/sendbird/sendbird-uikit-ios/releases/download/3.30.1/SendbirdUIKit.xcframework.zip", // SendbirdUIKit_URL
checksum: "e3ab20a55e5235ac8339ff40fab08cede60d691d7304cd5ac3f22713b57dc686" // SendbirdUIKit_CHECKSUM
),
.binaryTarget(
name: "SendbirdUIMessageTemplate",
url: "https://github.com/sendbird/sendbird-uikit-ios/releases/download/3.30.0/SendbirdUIMessageTemplate.xcframework.zip", // SendbirdUIMessageTemplate_URL
checksum: "10a2e3f694bf99feab335a3ee76363b0a7d7ffc96a0acb219ef56e0be6cc02b6" // SendbirdUIMessageTemplate_CHECKSUM
url: "https://github.com/sendbird/sendbird-uikit-ios/releases/download/3.30.1/SendbirdUIMessageTemplate.xcframework.zip", // SendbirdUIMessageTemplate_URL
checksum: "af0563350430be0ecb40d20d0365bf7f5210719055b4d274570a4a62cbcb2e8c" // SendbirdUIMessageTemplate_CHECKSUM
),
.target(
name: "SendbirdUIKitTarget",
Expand Down
10 changes: 5 additions & 5 deletions Sample/QuickStart.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3841,7 +3841,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.30.0;
MARKETING_VERSION = 3.30.1;
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.uikit.sample;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -3869,7 +3869,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.30.0;
MARKETING_VERSION = 3.30.1;
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.uikit.sample;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -4014,7 +4014,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.30.0;
MARKETING_VERSION = 3.30.1;
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.uikit.sample.NotificationService;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -4042,7 +4042,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.30.0;
MARKETING_VERSION = 3.30.1;
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.uikit.sample.NotificationService;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -4091,7 +4091,7 @@
repositoryURL = "https://github.com/sendbird/sendbird-uikit-ios-spm";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 3.30.0;
minimumVersion = 3.30.1;
};
};
A4CD81EE92C875D0E22463C6 /* XCRemoteSwiftPackageReference "sendbird-chat-sdk-ios" */ = {
Expand Down
7 changes: 3 additions & 4 deletions Sample/QuickStart/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
// GroupChannel - form type message
SendbirdUI.config.groupChannel.channel.isFormTypeMessageEnabled = true

// if #available(iOS 14, *) {
// SendbirdUI.config.groupChannel.channel.isMultipleFilesMessageEnabled = true
// }
if #available(iOS 14, *) {
SendbirdUI.config.groupChannel.channel.isMultipleFilesMessageEnabled = true
}
}

}
4 changes: 2 additions & 2 deletions Sample/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ packages:
from: 4.25.0
SendbirdUIKit:
url: https://github.com/sendbird/sendbird-uikit-ios-spm
from: 3.30.0
from: 3.30.1
schemes:
QuickStart:
analyze:
Expand All @@ -38,7 +38,7 @@ settingGroups:
FRAMEWORK_SEARCH_PATHS: ''
IPHONEOS_DEPLOYMENT_TARGET: '13.0'
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"]
MARKETING_VERSION: '3.30.0'
MARKETING_VERSION: '3.30.1'
PRODUCT_NAME: "$(TARGET_NAME)"
SDKROOT: iphoneos
SWIFT_VERSION: '5.0'
Expand Down
6 changes: 3 additions & 3 deletions SendBirdUIKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SendBirdUIKit"
s.version = "3.30.0"
s.version = "3.30.1"
s.summary = "UIKit based on SendbirdChatSDK"
s.description = "Sendbird UIKit is a framework composed of basic UI components based on SendbirdChatSDK."
s.homepage = "https://sendbird.com"
Expand All @@ -16,11 +16,11 @@ Pod::Spec.new do |s|
"Kai" => "[email protected]"
}
s.platform = :ios, "13.0"
s.source = { :http => "https://github.com/sendbird/sendbird-uikit-ios/releases/download/#{s.version}/SendBirdUIKit.zip", :sha1 => "64f5bcc2f19eb07a1f3377a23cca9d8fdf2c4cd6" }
s.source = { :http => "https://github.com/sendbird/sendbird-uikit-ios/releases/download/#{s.version}/SendBirdUIKit.zip", :sha1 => "610b00969eff50370717ed4bee7438d3fd557c07" }
s.ios.vendored_frameworks = 'SendBirdUIKit/SendbirdUIKit.xcframework'
s.ios.frameworks = ["UIKit", "Foundation", "CoreData", "SendbirdChatSDK"]
s.requires_arc = true
s.dependency "SendbirdChatSDK", ">= 4.25.0"
s.dependency "SendbirdUIMessageTemplate", ">= 3.30.0"
s.dependency "SendbirdUIMessageTemplate", ">= 3.30.1"
s.ios.library = "icucore"
end
4 changes: 2 additions & 2 deletions SendbirdUIMessageTemplate.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SendbirdUIMessageTemplate"
s.version = "3.30.0"
s.version = "3.30.1"
s.summary = "SendbirdUIMessageTemplate based on SendbirdChatSDK"
s.description = "Sendbird UI MessageTemplate is a framework composed of basic Message Template UI components based on SendbirdChatSDK."
s.homepage = "https://sendbird.com"
Expand All @@ -15,7 +15,7 @@ Pod::Spec.new do |s|
"Kai" => "[email protected]"
}
s.platform = :ios, "13.0"
s.source = { :http => "https://github.com/sendbird/sendbird-uikit-ios/releases/download/#{s.version}/SendbirdUIMessageTemplate.zip", :sha1 => "0dfdb45fb8d87d8d9c1ea04e0f264f17187ec728" }
s.source = { :http => "https://github.com/sendbird/sendbird-uikit-ios/releases/download/#{s.version}/SendbirdUIMessageTemplate.zip", :sha1 => "cde473dad1b5007e08843c8088607d97351cf8a1" }
s.ios.vendored_frameworks = 'SendbirdUIMessageTemplate/SendbirdUIMessageTemplate.xcframework'
s.ios.frameworks = ["UIKit", "Foundation", "CoreData", "SendbirdChatSDK"]
s.requires_arc = true
Expand Down
1 change: 1 addition & 0 deletions Sources/Constant/SBUConstant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class SBUConstant {
static let thumbnailSize: CGSize = .init(width: 240, height: 160)
static let imageSize: CGSize = .init(width: 240, height: 160)
static let quotedMessageThumbnailSize: CGSize = .init(width: 156, height: 104)
static let quotedMessageIconSize: CGSize = .init(width: 48, height: 48)
static let parentInfoMultipleFilesThumbnailSize: CGSize = .init(width: 120, height: 120)

static let voiceMessageBaseSize: CGSize = .init(width: 136, height: 44)
Expand Down
57 changes: 56 additions & 1 deletion Sources/View/Channel/CellView/SBUUserMessageTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ open class SBUUserMessageTextView: SBUView {
public var channelType: ChannelType = .group
public var isWebType = false

var longPressHandler: ((URL) -> Void)?
var longPressHandler: ((URL?) -> Void)?

public var mentionManager: SBUMentionManager?

Expand Down Expand Up @@ -222,6 +222,9 @@ open class SBUUserMessageTextView: SBUView {
}

extension SBUUserMessageTextView: UITextViewDelegate {

/// Handles tap and longpress on a URL link or a mentioned user for iOS below 17.0.
@available(iOS, deprecated: 17.0)
open func textView(
_ textView: UITextView,
shouldInteractWith URL: URL,
Expand All @@ -231,18 +234,70 @@ extension SBUUserMessageTextView: UITextViewDelegate {
if let mentionManager = mentionManager {
if let mention = mentionManager.findMentions(with: characterRange).first,
interaction == .invokeDefaultAction {
// Mention tapped
self.delegate?.userMessageTextView(self, didTapMention: mention.user)
return false
} else {
// Mention longpressed
(self.superview as? SBUUserMessageCell)?.longPressHandlerToContent?()
}
}
if interaction == .presentActions {
// URL link longpressed
self.longPressHandler?(URL)
} else if interaction == .invokeDefaultAction {
// URL link tapped
URL.open()
}

return false
}

/// Handles tap on a URL link or a mentioned user for iOS 17.0 or above.
/// - Since: 3.30.1
@available(iOS 17.0, *)
open func textView(
_ textView: UITextView,
primaryActionFor textItem: UITextItem,
defaultAction: UIAction
) -> UIAction? {
let characterRange = textItem.range
if let mentionManager = mentionManager {
if let mention = mentionManager.findMentions(with: characterRange).first {
// Mention tapped
return UIAction(title: "Mention Tapped") { _ in
self.delegate?.userMessageTextView(self, didTapMention: mention.user)
}
}
} else if let tappedURL = textView.textStorage.attribute(.link, at: characterRange.location, effectiveRange: nil) as? URL {
// URL link tapped
return UIAction(title: "Link Tapped") { _ in
tappedURL.open()
}
}

return nil
}

/// Handles longpress on a URL link or a mentioned user for iOS 17.0 or above.
/// - Since: 3.30.1
@available(iOS 17.0, *)
open func textView(
_ textView: UITextView,
menuConfigurationFor textItem: UITextItem,
defaultMenu: UIMenu
) -> UITextItem.MenuConfiguration? {
let characterRange = textItem.range
if let mentionManager = mentionManager {
if mentionManager.findMentions(with: characterRange).first != nil {
// Mention longpressed
self.longPressHandler?(nil)
}
} else if let tappedURL = textView.textStorage.attribute(.link, at: characterRange.location, effectiveRange: nil) as? URL {
// URL link longpressed
self.longPressHandler?(tappedURL)
}

return nil
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ open class QuotedFileImageContentView: SBUView {

self.setupSizeContraint()

let iconSize = SBUConstant.quotedMessageIconSize
self.iconImageView
.sbu_constraint(equalTo: self, centerX: 0, centerY: 0)
.sbu_constraint(width: 48, height: 48)
.sbu_constraint(width: iconSize.width, height: iconSize.height)
.layoutIfNeeded()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import SendbirdChatSDK

open class SBUQuotedFileMessageView: SBUQuotedBaseMessageView {
/// The string value of file URL.
Expand All @@ -23,6 +24,8 @@ open class SBUQuotedFileMessageView: SBUQuotedBaseMessageView {
return UIView()
}()

// TODO: Remove this property.
// This property is not used anywhere, but left it here because it's public.
public var imageView: UIImageView = {
let imageView = UIImageView()
imageView.clipsToBounds = true
Expand Down Expand Up @@ -68,6 +71,18 @@ open class SBUQuotedFileMessageView: SBUQuotedBaseMessageView {
self.urlString = urlString
super.configure(with: configuration)

#if SWIFTUI
if configuration.message.parentMessage is FileMessage {
if self.applyViewConverter(.quotedFileMessage, configuration: configuration) {
return
}
} else if configuration.message.parentMessage is MultipleFilesMessage {
if self.applyViewConverter(.quotedMultipleFilesMessage, configuration: configuration) {
return
}
}
#endif

switch messageFileType {
case .image, .video:
if !(self.messageFileView is QuotedFileImageContentView) {
Expand Down