@@ -17,14 +17,16 @@ public struct ChatChannelListView<Factory: ViewFactory>: View {
17
17
private let viewFactory : Factory
18
18
private let title : String
19
19
private var onItemTap : ( ChatChannel ) -> Void
20
+ private var handleTabBarVisibility : Bool
20
21
21
22
public init (
22
23
viewFactory: Factory ,
23
24
viewModel: ChatChannelListViewModel ? = nil ,
24
25
channelListController: ChatChannelListController ? = nil ,
25
26
title: String = " Stream Chat " ,
26
27
onItemTap: ( ( ChatChannel ) -> Void ) ? = nil ,
27
- selectedChannelId: String ? = nil
28
+ selectedChannelId: String ? = nil ,
29
+ handleTabBarVisibility: Bool = true
28
30
) {
29
31
let channelListVM = viewModel ?? ViewModelsFactory . makeChannelListViewModel (
30
32
channelListController: channelListController,
@@ -35,6 +37,7 @@ public struct ChatChannelListView<Factory: ViewFactory>: View {
35
37
)
36
38
self . viewFactory = viewFactory
37
39
self . title = title
40
+ self . handleTabBarVisibility = handleTabBarVisibility
38
41
if let onItemTap = onItemTap {
39
42
self . onItemTap = onItemTap
40
43
} else {
@@ -95,7 +98,7 @@ public struct ChatChannelListView<Factory: ViewFactory>: View {
95
98
view. navigationViewStyle ( . stack)
96
99
} )
97
100
. background (
98
- isIphone ?
101
+ isIphone && handleTabBarVisibility ?
99
102
Color . clear. background (
100
103
TabBarAccessor { tabBar in
101
104
self . tabBar = tabBar
@@ -105,7 +108,7 @@ public struct ChatChannelListView<Factory: ViewFactory>: View {
105
108
: nil
106
109
)
107
110
. onReceive ( viewModel. $hideTabBar) { newValue in
108
- if isIphone {
111
+ if isIphone && handleTabBarVisibility {
109
112
self . setupTabBarAppeareance ( )
110
113
self . tabBar? . isHidden = newValue
111
114
}
0 commit comments