From fcb5f17eccb1fdc27315d6819aaa9854ab09ce8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E7=BB=A7=E8=B6=85?= <984065974@qq.com> Date: Mon, 25 Aug 2025 19:36:15 +0800 Subject: [PATCH 1/2] fix conflict with ChatUIkit --- README.md | 15 ++++++++------- .../Commons/Extension/ArrayExtension.swift | 4 ++-- .../Classes/Commons/Theme/ColorTheme.swift | 12 ++++++------ .../Classes/Commons/Utils/CallNavigationBar.swift | 4 ++-- .../Implements/CallKitManager+RTC.swift | 2 +- .../MultiCallParticipantsController.swift | 6 +++--- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 04141d5..2f3ebae 100644 --- a/README.md +++ b/README.md @@ -264,10 +264,11 @@ class AppDelegate:UIResponder,UIApplicationDelegate { - + + @@ -278,6 +279,7 @@ class AppDelegate:UIResponder,UIApplicationDelegate { + @@ -287,8 +289,8 @@ class AppDelegate:UIResponder,UIApplicationDelegate { + - @@ -298,8 +300,8 @@ class AppDelegate:UIResponder,UIApplicationDelegate { + - @@ -308,7 +310,7 @@ class AppDelegate:UIResponder,UIApplicationDelegate { - + @@ -326,7 +328,6 @@ class AppDelegate:UIResponder,UIApplicationDelegate { - @@ -337,14 +338,14 @@ class AppDelegate:UIResponder,UIApplicationDelegate { - + - + diff --git a/Sources/EaseCallUIKit/Classes/Commons/Extension/ArrayExtension.swift b/Sources/EaseCallUIKit/Classes/Commons/Extension/ArrayExtension.swift index 2f0f34e..221e05f 100644 --- a/Sources/EaseCallUIKit/Classes/Commons/Extension/ArrayExtension.swift +++ b/Sources/EaseCallUIKit/Classes/Commons/Extension/ArrayExtension.swift @@ -28,12 +28,12 @@ public extension Array { } ///数组越界防护 - subscript(safe idx: Index) -> Element? { + subscript(safely idx: Index) -> Element? { if idx < 0 { return nil } return idx < self.endIndex ? self[idx] : nil } - subscript(safe range: Range) -> ArraySlice? { + subscript(safely range: Range) -> ArraySlice? { if range.startIndex < 0 { return nil } return range.endIndex <= self.endIndex ? self[range.startIndex...range.endIndex]:nil } diff --git a/Sources/EaseCallUIKit/Classes/Commons/Theme/ColorTheme.swift b/Sources/EaseCallUIKit/Classes/Commons/Theme/ColorTheme.swift index 2974dc3..ead7f7a 100644 --- a/Sources/EaseCallUIKit/Classes/Commons/Theme/ColorTheme.swift +++ b/Sources/EaseCallUIKit/Classes/Commons/Theme/ColorTheme.swift @@ -140,22 +140,22 @@ public extension UIColor { @objcMembers class ColorTheme: NSObject { internal static func switchHues(hues: [CGFloat]) { - if let primaryHue = hues[safe: 0] { + if let primaryHue = hues[safely: 0] { self.primaryHue = primaryHue } - if let secondaryHue = hues[safe: 1] { + if let secondaryHue = hues[safely: 1] { self.secondaryHue = secondaryHue } - if let errorHue = hues[safe: 2] { + if let errorHue = hues[safely: 2] { self.errorHue = errorHue } - if let neutralHue = hues[safe: 3] { + if let neutralHue = hues[safely: 3] { self.neutralHue = neutralHue } - if let neutralSpecialHue = hues[safe: 4] { + if let neutralSpecialHue = hues[safely: 4] { self.neutralSpecialHue = neutralSpecialHue } - if let gradientEndHue = hues[safe: 5] { + if let gradientEndHue = hues[safely: 5] { self.gradientEndHue = gradientEndHue } } diff --git a/Sources/EaseCallUIKit/Classes/Commons/Utils/CallNavigationBar.swift b/Sources/EaseCallUIKit/Classes/Commons/Utils/CallNavigationBar.swift index 47e3552..f1a7b45 100644 --- a/Sources/EaseCallUIKit/Classes/Commons/Utils/CallNavigationBar.swift +++ b/Sources/EaseCallUIKit/Classes/Commons/Utils/CallNavigationBar.swift @@ -300,9 +300,9 @@ extension CallNavigationBar: UICollectionViewDataSource,UICollectionViewDelegate public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "EaseChatNavigationBarRightCell", for: indexPath) as? EaseChatNavigationBarRightCell if self.originalRenderRightImage { - cell?.imageView.image = self.rightImages[safe: indexPath.row] + cell?.imageView.image = self.rightImages[safely: indexPath.row] } else { - cell?.imageView.image = self.rightImages[safe: indexPath.row]?.withTintColor(Theme.style == .dark ? UIColor.callTheme.neutralColor98:UIColor.callTheme.neutralColor3) + cell?.imageView.image = self.rightImages[safely: indexPath.row]?.withTintColor(Theme.style == .dark ? UIColor.callTheme.neutralColor98:UIColor.callTheme.neutralColor3) } return cell ?? UICollectionViewCell() } diff --git a/Sources/EaseCallUIKit/Classes/CoreService/Implements/CallKitManager+RTC.swift b/Sources/EaseCallUIKit/Classes/CoreService/Implements/CallKitManager+RTC.swift index 1e9c61d..471dcd5 100644 --- a/Sources/EaseCallUIKit/Classes/CoreService/Implements/CallKitManager+RTC.swift +++ b/Sources/EaseCallUIKit/Classes/CoreService/Implements/CallKitManager+RTC.swift @@ -125,7 +125,7 @@ extension CallKitManager: AgoraRtcEngineDelegate { consoleLogInfo("rtcEngine networkQuality uid: \(uid) txQuality: \(txQuality.rawValue) rxQuality: \(rxQuality.rawValue) is unknown, skipping update", type: .debug) return } - let uids = [NSNumber(value: uid)] + let uids = [NSNumber(value: uid == 0 ? UInt32(uid):self.currentUserRTCUID)] // Get userId by RTC uid ChatClient.shared().getUserId(byRTCUIds: uids) { [weak self] relations, error in guard let `self` = self else { return } diff --git a/Sources/EaseCallUIKit/Classes/UI/Controllers/MultiCallParticipantsController.swift b/Sources/EaseCallUIKit/Classes/UI/Controllers/MultiCallParticipantsController.swift index a15b9c5..da07a9c 100644 --- a/Sources/EaseCallUIKit/Classes/UI/Controllers/MultiCallParticipantsController.swift +++ b/Sources/EaseCallUIKit/Classes/UI/Controllers/MultiCallParticipantsController.swift @@ -187,7 +187,7 @@ extension MultiCallParticipantsController: UITableViewDelegate,UITableViewDataSo if cell == nil { cell = GroupParticipantsCell(style: .default, reuseIdentifier: "GroupParticipantsCell") } - if let profile = self.participants[safe: indexPath.row] { + if let profile = self.participants[safely: indexPath.row] { cell?.refresh(profile: profile, keyword: "") cell?.nickName.textColor = .white } @@ -201,7 +201,7 @@ extension MultiCallParticipantsController: UITableViewDelegate,UITableViewDataSo } @objc open func didSelectRowAt(indexPath: IndexPath) { - if let profile = self.participants[safe: indexPath.row] { + if let profile = self.participants[safely: indexPath.row] { profile.selected = !profile.selected self.participantsList.reloadData() } @@ -225,7 +225,7 @@ extension MultiCallParticipantsController: UITableViewDelegate,UITableViewDataSo self.fetchParticipants() } var unknownInfoIds = [String]() - if let profile = self.participants[safe: indexPath.row] { + if let profile = self.participants[safely: indexPath.row] { if profile.nickname.isEmpty || profile.avatarURL.isEmpty { unknownInfoIds.append(profile.id) } From 9ce80a7132aa4ea6850448126d0f040db709dc56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E7=BB=A7=E8=B6=85?= <984065974@qq.com> Date: Mon, 25 Aug 2025 20:03:49 +0800 Subject: [PATCH 2/2] Update README.md --- README.md | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 2f3ebae..0b847ee 100644 --- a/README.md +++ b/README.md @@ -252,11 +252,11 @@ class AppDelegate:UIResponder,UIApplicationDelegate { ``` XML - - + + - + @@ -268,28 +268,27 @@ class AppDelegate:UIResponder,UIApplicationDelegate { - - - + + - + - + - + - + @@ -323,7 +322,7 @@ class AppDelegate:UIResponder,UIApplicationDelegate { - + - + - - + + @@ -362,12 +361,18 @@ class AppDelegate:UIResponder,UIApplicationDelegate { + + + + + +