Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/swiftui/1.0.3 -> main #23

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## New Interfaces
New view adaptor interfaces for `GroupChannelType.ListItem` have been added.
- `public func quotedFileMessageView<Content: View>(@ViewBuilder content:)`
- An interface that customizes a quoted file message view.
- `public func quotedMultipleFilesMessageView<Content: View>(@ViewBuilder content:)`
- An interface that customizes a quoted multiple files message view.
## New Interfaces
- Added `GlobalOptions.enableViewAdaptorAutoReset`
- This option decides whether to reset customized view adaptors whenever SendbirdSwiftUI View's `onDisappear` is called.
- Set this flag to `false` before a specific SendbirdSwiftUI View appears, if you want to prevent its customized views from resetting, even after its `onDisappear` is called.

## Improvements
- Fixed customized SendbirdSwiftUI View's customized styles being reset whenever a SendbirdSwiftUI View 's `onDisappear` is called (e.g., when coming back from another `TabView`)
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ let package = Package(
targets: [
.binaryTarget(
name: "SendbirdSwiftUI",
url: "https://github.com/sendbird/sendbird-swiftui-ios/releases/download/1.0.2/SendbirdSwiftUI.xcframework.zip",
checksum: "ac1f1a4d878b1564d27f00470f5466bf1ce033b239e647c6fe9e4033c3bcbf62"
url: "https://github.com/sendbird/sendbird-swiftui-ios/releases/download/1.0.3/SendbirdSwiftUI.xcframework.zip",
checksum: "4599d0209a95045c1aee95fb9d90d7caeb6df284d2e9810a057aa6a893ac0120"

),
.target(
Expand Down
14 changes: 9 additions & 5 deletions Sample/QuickStartSwiftUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
338BE5281B09CD9862D8B40F /* SBUUserMessageTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 608274ACB42DDAE6A5976FC6 /* SBUUserMessageTextView.swift */; };
33F211B7F47CC6FC91C639AF /* SBUCreateGroupChannelUserCell+SwiftUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A63BAEF80ECC309FA1E7669 /* SBUCreateGroupChannelUserCell+SwiftUI.swift */; };
3407C53E67355F05BD5568CC /* SBUCoverImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0C6B3B15A2C99291A025E96 /* SBUCoverImageView.swift */; };
340E18B59A67E5C046A9241D /* GlobalOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1502118E1864D319404F249C /* GlobalOptions.swift */; };
3412D19373A8ACC77B9277AA /* OpenOperatorListView+SubViewBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F32A69B02CCE4166DE09F9D /* OpenOperatorListView+SubViewBuilder.swift */; };
3416FD182734700D48191237 /* SBUOpenBannedUserListUserCell+SwiftUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 934D088DA1735729346CE8C0 /* SBUOpenBannedUserListUserCell+SwiftUI.swift */; };
34C3EFDD816902E6ABBD97A4 /* SBUMessageFormChipsItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F7C5297FA101765F9784775 /* SBUMessageFormChipsItemView.swift */; };
Expand Down Expand Up @@ -1211,6 +1212,7 @@
149EF5C6D56F66FA509EA283 /* SBUGroupChannelModule.List+SwiftUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SBUGroupChannelModule.List+SwiftUI.swift"; sourceTree = "<group>"; };
14A5CBF9A05A44B87429CDCC /* FontSet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontSet.swift; sourceTree = "<group>"; };
14EA076EB6C73BA4290914FE /* CustomOpenMutedParticipantList.ViewConverter.List.profileImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomOpenMutedParticipantList.ViewConverter.List.profileImage.swift; sourceTree = "<group>"; };
1502118E1864D319404F249C /* GlobalOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlobalOptions.swift; sourceTree = "<group>"; };
151589C04C2127E51ABCF91D /* SBUGroupChannelListModule.Header.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBUGroupChannelListModule.Header.swift; sourceTree = "<group>"; };
15269264474C5B46CF1910BE /* SBUInviteUserModule.List+SwiftUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SBUInviteUserModule.List+SwiftUI.swift"; sourceTree = "<group>"; };
1594F63CF9E5FDE4E1A20E4E /* CustomOpenBannedUserList.ViewConverter.Header.titleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomOpenBannedUserList.ViewConverter.Header.titleView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -5029,6 +5031,7 @@
A9779DBC3ABC5BEFFBF2DC74 /* Common */ = {
isa = PBXGroup;
children = (
1502118E1864D319404F249C /* GlobalOptions.swift */,
2B50481174F97B1EE25DA725 /* Sendbird.swift */,
EB9EAE40ED4B2267D13C0B8C /* Sendbird+Typealias.swift */,
);
Expand Down Expand Up @@ -6864,6 +6867,7 @@
AEF6E6E5D58A1C14EADDF06B /* Float+SBUIKit.swift in Sources */,
53E5046D24EFD425EE0B8F01 /* FontSet.swift in Sources */,
28B038F489F6B33DF70C5A30 /* Formatter+SBUIKit.swift in Sources */,
340E18B59A67E5C046A9241D /* GlobalOptions.swift in Sources */,
F7F5896DD491728C5E9CBBB6 /* GroupBannedUserListView+Item.swift in Sources */,
93A5253A6300B53E76CB790C /* GroupBannedUserListView+SubViewBuilder.swift in Sources */,
48061E8A6A2CCB8E3B410263 /* GroupBannedUserListView+ViewConverter.swift in Sources */,
Expand Down Expand Up @@ -7611,7 +7615,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.swiftui.sample;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -7643,7 +7647,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.swiftui.sample.SwiftUINotificationService;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -7733,7 +7737,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.swiftui.sample;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -7820,7 +7824,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = com.sendbird.swiftui.sample.SwiftUINotificationService;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -7877,7 +7881,7 @@
repositoryURL = "https://github.com/sendbird/sendbird-uikit-ios-spm";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 3.30.0;
minimumVersion = 3.30.1;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ struct CustomSampleSubView: View {
Button(action: {
Task {
await viewModel.loadEnvironment(for: viewItem)
// NOTE: Use the below if you want to change `enableViewAdaptorAutoReset` setting for a specific view.
// if viewItem.viewFullPath == "CustomGroupChannel.ViewConverter.List.fileMessageView" {
// GlobalOptions.enableViewAdaptorAutoReset = false
// } else {
// GlobalOptions.enableViewAdaptorAutoReset = true
// }
self.destinationView = AnyView(
CustomSampleManager.viewForName(viewItem)
.environmentObject(viewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class CustomSampleSubViewModel: ObservableObject {
return
}

SBViewConverterSet.resetAll()
// NOTE: No longer need to call this since GlobalOptions.enableViewAdaptorAutoReset was added.
// But use it if you later need it.
// SBViewConverterSet.resetAll()

// TODO: messageThread 나 setting 등 처리는 여기서 옵션을 받거나 하는 형태로 처리
switch getRequiredDataContext(viewItem) {
Expand Down
4 changes: 2 additions & 2 deletions Sample/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ packages:
from: 4.25.0
SendbirdUIKit:
url: https://github.com/sendbird/sendbird-uikit-ios-spm
from: 3.30.0
from: 3.30.1

schemes:
QuickStartSwiftUI:
Expand Down Expand Up @@ -43,7 +43,7 @@ settingGroups:
FRAMEWORK_SEARCH_PATHS: ''
IPHONEOS_DEPLOYMENT_TARGET: '15.0'
LD_RUNPATH_SEARCH_PATHS: ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"]
MARKETING_VERSION: '1.0.2'
MARKETING_VERSION: '1.0.3'
PRODUCT_NAME: "$(TARGET_NAME)"
SDKROOT: iphoneos
SWIFT_VERSION: '5.0'
Expand Down
4 changes: 2 additions & 2 deletions SendbirdSwiftUI.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SendbirdSwiftUI"
s.version = "1.0.2"
s.version = "1.0.3"
s.summary = "Sendbird SwiftUI SDK based on SendbirdChatSDK"
s.description = "SendbirdSwiftUI is a framework composed of basic UI components based on SwiftUI and SendbirdChatSDK."
s.homepage = "https://sendbird.com"
Expand All @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
"Kai" => "[email protected]"
}
s.platform = :ios, "15.0"
s.source = { :http => "https://github.com/sendbird/sendbird-swiftui-ios/releases/download/#{s.version}/SendbirdSwiftUI.zip", :sha1 => "09d1fb86d655f79bcf1186e17fa804293ff3a4cc" }
s.source = { :http => "https://github.com/sendbird/sendbird-swiftui-ios/releases/download/#{s.version}/SendbirdSwiftUI.zip", :sha1 => "7c88cb1fe497fa8a44b0b5e9f890162f15aa544d" }
s.ios.vendored_frameworks = 'SendbirdSwiftUI/SendbirdSwiftUI.xcframework'
s.ios.frameworks = ["UIKit", "SwiftUI", "Foundation", "CoreData", "SendbirdChatSDK"]
s.requires_arc = true
Expand Down
18 changes: 18 additions & 0 deletions Sources/SwiftUI/Common/GlobalOptions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// GlobalOptions.swift
// SendbirdSwiftUI
//
// Created by Celine Moon on 3/18/25.
//

import Foundation

/// Class that manages global settings for SendbirdSwiftUI.
/// - Since: 1.0.3
public class GlobalOptions {
/// Decides whether to reset customized view adaptors whenever SendbirdSwiftUI View's `onDisappear` is called.
/// Set this flag to `false` before a specific SendbirdSwiftUI View appears, if you want to prevent its customized views from resetting, even after its `onDisappear` is called.
/// Set to `true` by default.
/// - Since: 1.0.3
public static var enableViewAdaptorAutoReset = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public struct CreateGroupChannelView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.CreateGroupChannel = CreateGroupChannelViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.CreateGroupChannel = CreateGroupChannelViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ public struct CreateOpenChannelView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.CreateOpenChannel = CreateOpenChannelViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.CreateOpenChannel = CreateOpenChannelViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public struct GroupBannedUserListView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.GroupBannedUserList = GroupBannedUserListViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.GroupBannedUserList = GroupBannedUserListViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ public struct GroupChannelView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.GroupChannel = GroupChannelViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.GroupChannel = GroupChannelViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public struct GroupChannelListView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.GroupChannelList = GroupChannelListViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.GroupChannelList = GroupChannelListViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public struct GroupChannelPushSettingsView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.GroupChannelPushSettings = GroupChannelPushSettingsViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.GroupChannelPushSettings = GroupChannelPushSettingsViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public struct GroupChannelRegisterOperatorView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.GroupChannelRegisterOperator = GroupChannelRegisterOperatorViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.GroupChannelRegisterOperator = GroupChannelRegisterOperatorViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public struct GroupChannelSettingsView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.GroupChannelSettings = GroupChannelSettingsViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.GroupChannelSettings = GroupChannelSettingsViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public struct GroupMemberListView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.GroupMemberList = GroupMemberListViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.GroupMemberList = GroupMemberListViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public struct GroupModerationsView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.GroupModerations = GroupModerationsViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.GroupModerations = GroupModerationsViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public struct GroupMutedMemberListView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.GroupMutedMemberList = GroupMutedMemberListViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.GroupMutedMemberList = GroupMutedMemberListViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public struct GroupOperatorListView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.GroupOperatorList = GroupOperatorListViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.GroupOperatorList = GroupOperatorListViewConverter()
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion Sources/SwiftUI/KeyFunctions/InviteUser/InviteUserView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public struct InviteUserView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.InviteUser = InviteUserViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.InviteUser = InviteUserViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public struct MessageSearchView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.MessageSearch = MessageSearchViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.MessageSearch = MessageSearchViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ public struct MessageThreadView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.MessageThread = MessageThreadViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.MessageThread = MessageThreadViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public struct OpenBannedUserListView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.OpenBannedUserList = OpenBannedUserListViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.OpenBannedUserList = OpenBannedUserListViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public struct OpenChannelView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.OpenChannel = OpenChannelViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.OpenChannel = OpenChannelViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public struct OpenChannelListView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.OpenChannelList = OpenChannelListViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.OpenChannelList = OpenChannelListViewConverter()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public struct OpenChannelRegisterOperatorView: View {
}
.switchUIKitNavigationBar()
.onDisappear {
SBViewConverterSet.OpenChannelRegisterOperator = OpenChannelRegisterOperatorViewConverter()
if GlobalOptions.enableViewAdaptorAutoReset {
SBViewConverterSet.OpenChannelRegisterOperator = OpenChannelRegisterOperatorViewConverter()
}
}
}

Expand Down
Loading