diff --git a/CHANGELOG.md b/CHANGELOG.md index d534d673..dc86d339 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). # Upcoming -### 🔄 Changed +### ✅ Added +- Public init of PhotoAttachmentCell [#544](https://github.com/GetStream/stream-chat-swiftui/pull/544) +- Public init for AudioRecordingInfo [547](https://github.com/GetStream/stream-chat-swiftui/pull/547) + +### 🐞 Fixed +- Update of search results when slowly typing [#550](https://github.com/GetStream/stream-chat-swiftui/issues/550) # [4.59.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.59.0) _July 10, 2024_ diff --git a/DemoAppSwiftUI/AppDelegate.swift b/DemoAppSwiftUI/AppDelegate.swift index a7b3dc3d..43778074 100644 --- a/DemoAppSwiftUI/AppDelegate.swift +++ b/DemoAppSwiftUI/AppDelegate.swift @@ -54,8 +54,6 @@ class AppDelegate: NSObject, UIApplicationDelegate { streamChat = StreamChat(chatClient: chatClient, utils: utils) */ - StreamRuntimeCheck._isBackgroundMappingEnabled = true - #if RELEASE // We're tracking Crash Reports / Issues from the Demo App to keep improving the SDK SentrySDK.start { options in diff --git a/Package.swift b/Package.swift index c880fe88..a8f31100 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.59.0"), + .package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.60.0"), ], targets: [ .target( diff --git a/Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListViewModel.swift b/Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListViewModel.swift index 2b9c523d..2265d8a4 100644 --- a/Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListViewModel.swift +++ b/Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListViewModel.swift @@ -8,7 +8,8 @@ import SwiftUI import UIKit /// View model for the `ChatChannelListView`. -open class ChatChannelListViewModel: ObservableObject, ChatChannelListControllerDelegate { +open class ChatChannelListViewModel: ObservableObject, ChatChannelListControllerDelegate, ChatMessageSearchControllerDelegate { + /// Context provided dependencies. @Injected(\.chatClient) private var chatClient: ChatClient @Injected(\.images) private var images: Images @@ -103,7 +104,9 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController @Published public var searchText = "" { didSet { - handleSearchTextChange() + if searchText != oldValue { + handleSearchTextChange() + } } } @@ -244,6 +247,12 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController selectedChannel = channels.first?.channelSelectionInfo } } + + // MARK: - ChatMessageSearchControllerDelegate + + public func controller(_ controller: ChatMessageSearchController, didChangeMessages changes: [ListChange]) { + updateSearchResults() + } // MARK: - private @@ -324,6 +333,7 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController if !searchText.isEmpty { guard let userId = chatClient.currentUserId else { return } messageSearchController = chatClient.messageSearchController() + messageSearchController?.delegate = self let query = MessageSearchQuery( channelFilter: .containMembers(userIds: [userId]), messageFilter: .autocomplete(.text, text: searchText) @@ -334,6 +344,7 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController self?.updateSearchResults() }) } else { + messageSearchController?.delegate = nil messageSearchController = nil searchResults = [] updateChannels() diff --git a/StreamChatSwiftUI-XCFramework.podspec b/StreamChatSwiftUI-XCFramework.podspec index 50506f2f..2f85882d 100644 --- a/StreamChatSwiftUI-XCFramework.podspec +++ b/StreamChatSwiftUI-XCFramework.podspec @@ -19,7 +19,7 @@ Pod::Spec.new do |spec| spec.framework = 'Foundation', 'UIKit', 'SwiftUI' - spec.dependency 'StreamChat-XCFramework', '~> 4.59.0' + spec.dependency 'StreamChat-XCFramework', '~> 4.60.0' spec.cocoapods_version = '>= 1.11.0' end diff --git a/StreamChatSwiftUI.podspec b/StreamChatSwiftUI.podspec index 0c264531..7be44ae3 100644 --- a/StreamChatSwiftUI.podspec +++ b/StreamChatSwiftUI.podspec @@ -19,5 +19,5 @@ Pod::Spec.new do |spec| spec.framework = 'Foundation', 'UIKit', 'SwiftUI' - spec.dependency 'StreamChat', '~> 4.59.0' + spec.dependency 'StreamChat', '~> 4.60.0' end diff --git a/StreamChatSwiftUI.xcodeproj/project.pbxproj b/StreamChatSwiftUI.xcodeproj/project.pbxproj index 7e4a6bbd..12a08623 100644 --- a/StreamChatSwiftUI.xcodeproj/project.pbxproj +++ b/StreamChatSwiftUI.xcodeproj/project.pbxproj @@ -3705,7 +3705,7 @@ repositoryURL = "https://github.com/GetStream/stream-chat-swift.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 4.59.0; + minimumVersion = 4.60.0; }; }; E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {