From aaf8ac634f0ee3e85650b0a21f448c27130a5b39 Mon Sep 17 00:00:00 2001 From: Martin Mitrevski Date: Wed, 13 Aug 2025 11:23:15 +0200 Subject: [PATCH 1/5] Fix button in nav bar on iOS 26 --- .../ChannelHeader/CustomChannelHeader.swift | 36 +++++++++++++------ .../ChatChannelHeaderViewModifier.swift | 26 ++++++++++---- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift b/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift index 63dd46248..e150c8246 100644 --- a/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift +++ b/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift @@ -30,6 +30,7 @@ public struct CustomChannelHeader: ToolbarContent { Image(uiImage: images.messageActionEdit) .resizable() .scaledToFit() + .frame(width: 24, height: 24) .foregroundColor(Color.white) .padding(.all, 8) .background(colors.tintColor) @@ -41,9 +42,12 @@ public struct CustomChannelHeader: ToolbarContent { Button { actionsPopupShown = true } label: { - StreamLazyImage(url: currentUserController.currentUser?.imageURL) - .accessibilityLabel("Account Actions") - .accessibilityAddTraits(.isButton) + StreamLazyImage( + url: currentUserController.currentUser?.imageURL, + size: CGSize(width: 36, height: 36) + ) + .accessibilityLabel("Account Actions") + .accessibilityAddTraits(.isButton) } } } @@ -62,13 +66,25 @@ struct CustomChannelModifier: ChannelListHeaderViewModifier { func body(content: Content) -> some View { ZStack { - content.toolbar { - CustomChannelHeader( - title: title, - currentUserController: chatClient.currentUserController(), - isNewChatShown: $isNewChatShown, - actionsPopupShown: $actionsPopupShown - ) + if #available(iOS 26, *) { + content.toolbar { + CustomChannelHeader( + title: title, + currentUserController: chatClient.currentUserController(), + isNewChatShown: $isNewChatShown, + actionsPopupShown: $actionsPopupShown + ) + .sharedBackgroundVisibility(.hidden) + } + } else { + content.toolbar { + CustomChannelHeader( + title: title, + currentUserController: chatClient.currentUserController(), + isNewChatShown: $isNewChatShown, + actionsPopupShown: $actionsPopupShown + ) + } } NavigationLink(isActive: $blockedUsersShown) { diff --git a/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift b/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift index 2931fb8ad..7246e1d7b 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift @@ -108,13 +108,25 @@ public struct DefaultChannelHeaderModifier: ChatChannelHea } public func body(content: Content) -> some View { - content.toolbar { - DefaultChatChannelHeader( - factory: factory, - channel: channel, - headerImage: channelHeaderLoader.image(for: channel), - isActive: $isActive - ) + if #available(iOS 26, *) { + content.toolbar { + DefaultChatChannelHeader( + factory: factory, + channel: channel, + headerImage: channelHeaderLoader.image(for: channel), + isActive: $isActive + ) + .sharedBackgroundVisibility(.hidden) + } + } else { + content.toolbar { + DefaultChatChannelHeader( + factory: factory, + channel: channel, + headerImage: channelHeaderLoader.image(for: channel), + isActive: $isActive + ) + } } } } From 59080eddd933ad7ee0948d2e40bbe61cd86cc672 Mon Sep 17 00:00:00 2001 From: Martin Mitrevski Date: Thu, 4 Sep 2025 11:21:58 +0200 Subject: [PATCH 2/5] Fix compiling on Xcode 16 --- DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift | 2 ++ .../ChannelHeader/ChatChannelHeaderViewModifier.swift | 2 ++ 2 files changed, 4 insertions(+) diff --git a/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift b/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift index e150c8246..ab26b626a 100644 --- a/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift +++ b/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift @@ -74,7 +74,9 @@ struct CustomChannelModifier: ChannelListHeaderViewModifier { isNewChatShown: $isNewChatShown, actionsPopupShown: $actionsPopupShown ) + #if compiler(>=6.2) .sharedBackgroundVisibility(.hidden) + #endif } } else { content.toolbar { diff --git a/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift b/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift index 11c16e22c..915c9121b 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift @@ -116,7 +116,9 @@ public struct DefaultChannelHeaderModifier: ChatChannelHea headerImage: channelHeaderLoader.image(for: channel), isActive: $isActive ) + #if compiler(>=6.2) .sharedBackgroundVisibility(.hidden) + #endif } } else { content.toolbar { From eeb8a936934abd250eb63847ba49993cf50a0287 Mon Sep 17 00:00:00 2001 From: Martin Mitrevski Date: Thu, 4 Sep 2025 11:43:41 +0200 Subject: [PATCH 3/5] Fixes --- Sources/StreamChatSwiftUI/ChatChannel/ChatChannelView.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/StreamChatSwiftUI/ChatChannel/ChatChannelView.swift b/Sources/StreamChatSwiftUI/ChatChannel/ChatChannelView.swift index 3349d48bb..dfdc25dd6 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/ChatChannelView.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/ChatChannelView.swift @@ -209,7 +209,11 @@ public struct ChatChannelView: View, KeyboardReadable { } private var generatingSnapshot: Bool { - tabBarAvailable && messageDisplayInfo != nil && !viewModel.reactionsShown + if #available(iOS 26, *) { + return false + } else { + return tabBarAvailable && messageDisplayInfo != nil && !viewModel.reactionsShown + } } private var bottomPadding: CGFloat { From 938751e724318e66614cea63b710cf8144e1e156 Mon Sep 17 00:00:00 2001 From: Martin Mitrevski Date: Thu, 4 Sep 2025 11:47:53 +0200 Subject: [PATCH 4/5] Fixes --- .../ChannelHeader/ChatChannelHeaderViewModifier.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift b/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift index 915c9121b..37a263ae4 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift @@ -117,7 +117,7 @@ public struct DefaultChannelHeaderModifier: ChatChannelHea isActive: $isActive ) #if compiler(>=6.2) - .sharedBackgroundVisibility(.hidden) + .sharedBackgroundVisibility(.hidden) #endif } } else { From 1a7ceb685df505d3a6ee48b6b7dd60879c22e828 Mon Sep 17 00:00:00 2001 From: Martin Mitrevski Date: Thu, 4 Sep 2025 14:13:35 +0200 Subject: [PATCH 5/5] Formatting --- DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift b/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift index ab26b626a..3886ff4c9 100644 --- a/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift +++ b/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift @@ -75,7 +75,7 @@ struct CustomChannelModifier: ChannelListHeaderViewModifier { actionsPopupShown: $actionsPopupShown ) #if compiler(>=6.2) - .sharedBackgroundVisibility(.hidden) + .sharedBackgroundVisibility(.hidden) #endif } } else {