You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5
5
6
6
### 🐞 Fixed
7
7
- Rare crash when accessing frame of the view [#607](https://github.com/GetStream/stream-chat-swiftui/pull/607)
8
+
-`ChatChannelListView` navigation did not trigger when using a custom container and its body reloaded [#609](https://github.com/GetStream/stream-chat-swiftui/pull/609)
Copy file name to clipboardExpand all lines: Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListView.swift
+34-13Lines changed: 34 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -16,10 +16,29 @@ public struct ChatChannelListView<Factory: ViewFactory>: View {
16
16
17
17
privateletviewFactory:Factory
18
18
privatelettitle:String
19
-
privatevaronItemTap:(ChatChannel)->Void
19
+
privateletcustomOnItemTap:((ChatChannel)->Void)?
20
20
privatevarembedInNavigationView:Bool
21
21
privatevarhandleTabBarVisibility:Bool
22
-
22
+
23
+
/// Creates a channel list view.
24
+
///
25
+
/// - Parameters:
26
+
/// - viewFactory: The view factory used for creating views used by the channel list.
27
+
/// - viewModel: The view model instance providing the data. Default view model is created if nil.
28
+
/// - channelListController: The channel list controller managing the list of channels used as a data souce for the view model. Default controller is created if nil.
29
+
/// - title: A title used as the navigation bar title.
30
+
/// - onItemTap: A closure for handling a tap on the channel item. Default closure updates the ``ChatChannelListViewModel/selectedChannel`` property in the view model.
31
+
/// - selectedChannelId: The id of a channel to be opened after the initial channel list load.
32
+
/// - handleTabBarVisibility: True, if TabBar visibility should be automatically updated.
33
+
/// - embedInNavigationView: True, if the channel list view should be embedded in a navigation stack.
34
+
///
35
+
/// Changing the instance of the passed in `viewModel` or `channelListController` does not have an effect without reloading the channel list view by assigning a custom identity. The custom identity should be refreshed when either of the passed in instances have been recreated.
36
+
/// ```swift
37
+
/// ChatChannelListView(
38
+
/// viewModel: viewModel
39
+
/// )
40
+
/// .id(myCustomViewIdentity)
41
+
/// ```
23
42
publicinit(
24
43
viewFactory:Factory=DefaultViewFactory.shared,
25
44
viewModel:ChatChannelListViewModel?=nil,
@@ -30,23 +49,25 @@ public struct ChatChannelListView<Factory: ViewFactory>: View {
0 commit comments