Skip to content

Commit 753ef67

Browse files
authored
Updated StreamChat dependency to 4.65.0 (#625)
* Updated StreamChat dependency to 4.65.0 * Format code according to swiftformat * Fix Tests * One more * Fix demo app linting
1 parent 6c5cfeb commit 753ef67

17 files changed

+63
-63
lines changed

DemoAppSwiftUI/DemoAppSwiftUIApp.swift

+9-9
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ struct DemoAppSwiftUIApp: App {
2727
case .notLoggedIn:
2828
LoginView()
2929
case .loggedIn:
30-
TabView {
31-
channelListView()
32-
.tabItem { Label("Chat", systemImage: "message") }
33-
.badge(appState.unreadCount.channels)
34-
threadListView()
35-
.tabItem { Label("Threads", systemImage: "text.bubble") }
36-
.badge(appState.unreadCount.threads)
37-
}
30+
TabView {
31+
channelListView()
32+
.tabItem { Label("Chat", systemImage: "message") }
33+
.badge(appState.unreadCount.channels)
34+
threadListView()
35+
.tabItem { Label("Threads", systemImage: "text.bubble") }
36+
.badge(appState.unreadCount.threads)
37+
}
3838
}
3939
}
4040
.onChange(of: appState.userState) { newValue in
@@ -104,7 +104,7 @@ class AppState: ObservableObject, CurrentChatUserControllerDelegate {
104104
private init() {}
105105

106106
func currentUserController(_ controller: CurrentChatUserController, didChangeCurrentUserUnreadCount: UnreadCount) {
107-
self.unreadCount = didChangeCurrentUserUnreadCount
107+
unreadCount = didChangeCurrentUserUnreadCount
108108
let totalUnreadBadge = unreadCount.channels + unreadCount.threads
109109
if #available(iOS 16.0, *) {
110110
UNUserNotificationCenter.current().setBadgeCount(totalUnreadBadge)

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let package = Package(
1616
)
1717
],
1818
dependencies: [
19-
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.64.0"),
19+
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.65.0"),
2020
],
2121
targets: [
2222
.target(

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListView.swift

+16-16
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,22 @@ public struct ChatChannelListView<Factory: ViewFactory>: View {
8181
view.navigationViewStyle(.stack)
8282
})
8383
.background(
84-
isIphone && handleTabBarVisibility ?
85-
Color.clear.background(
86-
TabBarAccessor { tabBar in
87-
self.tabBar = tabBar
88-
}
89-
)
90-
.allowsHitTesting(false)
91-
: nil
92-
)
93-
.onReceive(viewModel.$hideTabBar) { newValue in
94-
if isIphone && handleTabBarVisibility {
95-
self.setupTabBarAppeareance()
96-
self.tabBar?.isHidden = newValue
97-
}
98-
}
99-
.accessibilityIdentifier("ChatChannelListView")
84+
isIphone && handleTabBarVisibility ?
85+
Color.clear.background(
86+
TabBarAccessor { tabBar in
87+
self.tabBar = tabBar
88+
}
89+
)
90+
.allowsHitTesting(false)
91+
: nil
92+
)
93+
.onReceive(viewModel.$hideTabBar) { newValue in
94+
if isIphone && handleTabBarVisibility {
95+
self.setupTabBarAppeareance()
96+
self.tabBar?.isHidden = newValue
97+
}
98+
}
99+
.accessibilityIdentifier("ChatChannelListView")
100100
}
101101

102102
@ViewBuilder

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadList.swift

+8-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public struct ThreadList<Factory: ViewFactory, HeaderView: View, FooterView: Vie
3535
self.factory = factory
3636
self.threads = threads
3737
self.threadDestination = threadDestination
38-
self._selectedThread = selectedThread
38+
_selectedThread = selectedThread
3939
self.onItemTap = onItemTap
4040
self.onItemAppear = onItemAppear
4141
self.headerView = headerView
@@ -49,7 +49,7 @@ public struct ThreadList<Factory: ViewFactory, HeaderView: View, FooterView: Vie
4949
factory: factory,
5050
threads: threads,
5151
threadDestination: threadDestination,
52-
selectedThread: $selectedThread,
52+
selectedThread: $selectedThread,
5353
onItemTap: onItemTap,
5454
onItemAppear: onItemAppear
5555
)
@@ -82,7 +82,7 @@ public struct ThreadsLazyVStack<Factory: ViewFactory>: View {
8282
self.threadDestination = threadDestination
8383
self.onItemTap = onItemTap
8484
self.onItemAppear = onItemAppear
85-
self._selectedThread = selectedThread
85+
_selectedThread = selectedThread
8686
}
8787

8888
public var body: some View {
@@ -93,9 +93,11 @@ public struct ThreadsLazyVStack<Factory: ViewFactory>: View {
9393
threadDestination: threadDestination,
9494
selectedThread: $selectedThread
9595
)
96-
.background(factory.makeThreadListItemBackground(
97-
thread: thread,
98-
isSelected: selectedThread?.id == thread.id)
96+
.background(
97+
factory.makeThreadListItemBackground(
98+
thread: thread,
99+
isSelected: selectedThread?.id == thread.id
100+
)
99101
)
100102
.contentShape(Rectangle())
101103
.onTapGesture {

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListItem.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public struct ChatThreadListItemViewModel {
5151
parentMessageText = threadTitle
5252
} else {
5353
let formatter = InjectedValues[\.utils].messagePreviewFormatter
54-
parentMessageText = formatter.formatContent(for: thread.parentMessage)
54+
parentMessageText = formatter.formatContent(for: thread.parentMessage)
5555
}
5656
return L10n.Thread.Item.repliedTo(parentMessageText.trimmed)
5757
}

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListNavigatableItem.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public struct ChatThreadListNavigatableItem<ThreadListItem: View, ThreadDestinat
2424
self.thread = thread
2525
self.threadListItem = threadListItem
2626
self.threadDestination = threadDestination
27-
self._selectedThread = selectedThread
27+
_selectedThread = selectedThread
2828
self.handleTabBarVisibility = handleTabBarVisibility
2929
}
3030

@@ -55,7 +55,7 @@ public struct ThreadSelectionInfo: Identifiable {
5555

5656
public init(thread: ChatThread) {
5757
self.thread = thread
58-
self.id = thread.id
58+
id = thread.id
5959
}
6060
}
6161

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ public struct ChatThreadListContentView<Factory: ViewFactory>: View {
104104
ThreadList(
105105
factory: viewFactory,
106106
threads: viewModel.threads,
107-
threadDestination: viewFactory.makeThreadDestination(),
107+
threadDestination: viewFactory.makeThreadDestination(),
108108
selectedThread: $viewModel.selectedThread,
109109
onItemTap: { thread in
110110
viewModel.selectedThread = .init(thread: thread)
111111
},
112112
onItemAppear: { index in
113113
viewModel.didAppearThread(at: index)
114-
},
114+
},
115115
headerView: {
116116
viewFactory.makeThreadListHeaderView(viewModel: viewModel)
117117
},

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListViewModel.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ open class ChatThreadListViewModel: ObservableObject, ChatThreadListControllerDe
5555
@Published public var hasNewThreads: Bool = false
5656

5757
/// The ids of the new threads available to be fetched.
58-
private var newAvailableThreadIds: Set<MessageId> = [] {
59-
didSet {
60-
newThreadsCount = newAvailableThreadIds.count
61-
hasNewThreads = newThreadsCount > 0
62-
}
63-
}
58+
private var newAvailableThreadIds: Set<MessageId> = [] {
59+
didSet {
60+
newThreadsCount = newAvailableThreadIds.count
61+
hasNewThreads = newThreadsCount > 0
62+
}
63+
}
6464

6565
/// Creates a view model for the `ChatThreadListView`.
6666
///

Sources/StreamChatSwiftUI/ChatThreadList/NoThreadsView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import SwiftUI
77
/// Default SDK implementation for the view displayed when there are no threads available.
88
public struct NoThreadsView: View {
99

10-
public init () {}
10+
public init() {}
1111

1212
public var body: some View {
1313
NoContentView(

Sources/StreamChatSwiftUI/CommonViews/FloatingBannerViewModifier.swift

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ extension View {
2828
}
2929
}
3030

31-
3231
struct FloatingBannerViewModifier<BannerView: View>: ViewModifier {
3332
let alignment: Alignment
3433
var isPresented: Bool

Sources/StreamChatSwiftUI/CommonViews/Shimmer.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ struct Shimmer: ViewModifier {
2323
)
2424
.animation(
2525
.linear(duration: duration)
26-
.delay(delay)
27-
.repeatForever(autoreverses: false),
26+
.delay(delay)
27+
.repeatForever(autoreverses: false),
2828
value: isInitialState
2929
)
3030
.onAppear {
@@ -33,7 +33,6 @@ struct Shimmer: ViewModifier {
3333
}
3434
}
3535

36-
3736
extension View {
3837
/// Adds an animated shimmering effect to any view, typically to show that
3938
/// an operation is in progress.

Sources/StreamChatSwiftUI/DefaultViewFactory.swift

+1
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ extension ViewFactory {
238238
)
239239
}
240240
}
241+
241242
public func makeMessageListModifier() -> some ViewModifier {
242243
EmptyViewModifier()
243244
}

StreamChatSwiftUI-XCFramework.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'StreamChatSwiftUI-XCFramework'
3-
spec.version = '4.64.0'
3+
spec.version = '4.65.0'
44
spec.summary = 'StreamChat SwiftUI Chat Components'
55
spec.description = 'StreamChatSwiftUI SDK offers flexible SwiftUI components able to display data provided by StreamChat SDK.'
66

@@ -19,7 +19,7 @@ Pod::Spec.new do |spec|
1919

2020
spec.framework = 'Foundation', 'UIKit', 'SwiftUI'
2121

22-
spec.dependency 'StreamChat-XCFramework', '~> 4.64.0'
22+
spec.dependency 'StreamChat-XCFramework', '~> 4.65.0'
2323

2424
spec.cocoapods_version = '>= 1.11.0'
2525
end

StreamChatSwiftUI.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'StreamChatSwiftUI'
3-
spec.version = '4.64.0'
3+
spec.version = '4.65.0'
44
spec.summary = 'StreamChat SwiftUI Chat Components'
55
spec.description = 'StreamChatSwiftUI SDK offers flexible SwiftUI components able to display data provided by StreamChat SDK.'
66

@@ -19,5 +19,5 @@ Pod::Spec.new do |spec|
1919

2020
spec.framework = 'Foundation', 'UIKit', 'SwiftUI'
2121

22-
spec.dependency 'StreamChat', '~> 4.64.0'
22+
spec.dependency 'StreamChat', '~> 4.65.0'
2323
end

StreamChatSwiftUI.xcodeproj/project.pbxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -3821,7 +3821,7 @@
38213821
repositoryURL = "https://github.com/GetStream/stream-chat-swift.git";
38223822
requirement = {
38233823
kind = upToNextMajorVersion;
3824-
minimumVersion = 4.64.0;
3824+
minimumVersion = 4.65.0;
38253825
};
38263826
};
38273827
E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {

StreamChatSwiftUITests/Tests/ChatThreadList/ChatThreadListViewModel_Tests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class ChatThreadListViewModel_Tests: StreamChatTestCase {
172172
viewModel.eventsController(
173173
eventController,
174174
didReceiveEvent: ThreadMessageNewEvent(
175-
message: .mock(parentMessageId: .unique),
175+
message: .mock(parentMessageId: .unique),
176176
channel: .mock(cid: .unique),
177177
unreadCount: .noUnread,
178178
createdAt: .unique

StreamChatSwiftUITests/Tests/ChatThreadList/ChatThreadListView_Tests.swift

+8-9
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CustomFactory: ViewFactory {
7171

7272
private class MockChatThreadListViewModel: ChatThreadListViewModel {
7373
static func empty() -> MockChatThreadListViewModel {
74-
return MockChatThreadListViewModel(
74+
MockChatThreadListViewModel(
7575
threads: [],
7676
isLoading: false,
7777
isReloading: false,
@@ -86,7 +86,7 @@ private class MockChatThreadListViewModel: ChatThreadListViewModel {
8686
}
8787

8888
static func loading() -> MockChatThreadListViewModel {
89-
return MockChatThreadListViewModel(
89+
MockChatThreadListViewModel(
9090
threads: [],
9191
isLoading: true,
9292
isReloading: false,
@@ -101,7 +101,7 @@ private class MockChatThreadListViewModel: ChatThreadListViewModel {
101101
}
102102

103103
static func withThreads() -> MockChatThreadListViewModel {
104-
return MockChatThreadListViewModel(
104+
MockChatThreadListViewModel(
105105
threads: mockThreads,
106106
isLoading: false,
107107
isReloading: false,
@@ -116,7 +116,7 @@ private class MockChatThreadListViewModel: ChatThreadListViewModel {
116116
}
117117

118118
static func loadingMoreThreads() -> MockChatThreadListViewModel {
119-
return MockChatThreadListViewModel(
119+
MockChatThreadListViewModel(
120120
threads: mockThreads,
121121
isLoading: false,
122122
isReloading: false,
@@ -131,7 +131,7 @@ private class MockChatThreadListViewModel: ChatThreadListViewModel {
131131
}
132132

133133
static func reloadingThreads() -> MockChatThreadListViewModel {
134-
return MockChatThreadListViewModel(
134+
MockChatThreadListViewModel(
135135
threads: mockThreads,
136136
isLoading: false,
137137
isReloading: true,
@@ -146,7 +146,7 @@ private class MockChatThreadListViewModel: ChatThreadListViewModel {
146146
}
147147

148148
static func newThreadsAvailable() -> MockChatThreadListViewModel {
149-
return MockChatThreadListViewModel(
149+
MockChatThreadListViewModel(
150150
threads: mockThreads,
151151
isLoading: false,
152152
isReloading: false,
@@ -161,7 +161,7 @@ private class MockChatThreadListViewModel: ChatThreadListViewModel {
161161
}
162162

163163
static func errorLoadingThreads() -> MockChatThreadListViewModel {
164-
return MockChatThreadListViewModel(
164+
MockChatThreadListViewModel(
165165
threads: [],
166166
isLoading: false,
167167
isReloading: false,
@@ -176,7 +176,7 @@ private class MockChatThreadListViewModel: ChatThreadListViewModel {
176176
}
177177

178178
static func errorLoadingMoreThreads() -> MockChatThreadListViewModel {
179-
return MockChatThreadListViewModel(
179+
MockChatThreadListViewModel(
180180
threads: mockThreads,
181181
isLoading: false,
182182
isReloading: false,
@@ -223,7 +223,6 @@ private class MockChatThreadListViewModel: ChatThreadListViewModel {
223223
didChangeThreads changes: [ListChange<ChatThread>]
224224
) {}
225225

226-
227226
static var mockYoda = ChatUser.mock(id: .unique, name: "Yoda")
228227
static var mockVader = ChatUser.mock(id: .unique, name: "Vader")
229228

0 commit comments

Comments
 (0)