Skip to content

Commit 15f1919

Browse files
ggzgliAbySwifter
authored andcommitted
publish version 3.4.0
1 parent 80cf5fa commit 15f1919

29 files changed

+97
-93
lines changed

chat/demo/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ target 'ChatDemo' do
44
use_frameworks! :linkage => :static
55

66
pod 'AtomicXCore', :path => '../../../../../tuikit_engine/atomicx/swift/AtomicXCore'
7-
pod 'AtomicX/Chat', :path => '../../atomic-x/AtomicX.podspec'
7+
pod 'AtomicX/Chat', :path => '../../../ios_swiftui/AtomicX.podspec'
88
pod 'ChatUIKit', :path => '../uikit/ChatUIKit.podspec'
99
pod 'RTCRoomEngine', :path => '../../../../../tuikit_engine/RTCRoomEngine.podspec'
1010
# pod 'MessageList', :path => '../../atomic-x/Sources/MessageList'

chat/uikit/ContactsPage.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public struct ContactsPage: View {
77
@State private var showAddContactMenu = false
88
@State private var showAddFriend = false
99
@State private var showJoinGroup = false
10+
private let contactStore: ContactListStore
1011
let onShowMessage: ((ConversationInfo) -> Void)?
1112
let onContactClick: ((AZOrderedListItem) -> Void)?
1213
let onGroupClick: ((AZOrderedListItem) -> Void)?
@@ -16,6 +17,7 @@ public struct ContactsPage: View {
1617
let onBlackListClick: (() -> Void)?
1718

1819
public init(
20+
contactStore: ContactListStore = ContactListStore.create(),
1921
onShowMessage: ((ConversationInfo) -> Void)? = nil,
2022
onContactClick: ((AZOrderedListItem) -> Void)? = nil,
2123
onGroupClick: ((AZOrderedListItem) -> Void)? = nil,
@@ -24,6 +26,7 @@ public struct ContactsPage: View {
2426
onGroupListClick: (() -> Void)? = nil,
2527
onBlackListClick: (() -> Void)? = nil
2628
) {
29+
self.contactStore = contactStore
2730
self.onShowMessage = onShowMessage
2831
self.onContactClick = onContactClick
2932
self.onGroupClick = onGroupClick
@@ -36,7 +39,8 @@ public struct ContactsPage: View {
3639
public var body: some View {
3740
VStack(spacing: 0) {
3841
headerView
39-
ContactListWithNavigation(
42+
ContactList(
43+
contactStore: contactStore,
4044
onShowMessage: onShowMessage,
4145
onContactClick: onContactClick,
4246
onGroupClick: onGroupClick,
@@ -80,13 +84,13 @@ public struct ContactsPage: View {
8084
}
8185
)
8286
.sheet(isPresented: $showAddFriend) {
83-
AddFriendView()
87+
AddFriendView(contactStore: contactStore)
8488
}
8589
.sheet(isPresented: $showJoinGroup) {
86-
JoinGroupView()
90+
JoinGroupView(contactStore: contactStore)
8791
}
8892
}
89-
93+
9094
private var headerView: some View {
9195
HStack {
9296
Text(LocalizedChatString("TabContacts"))
@@ -109,4 +113,4 @@ public struct ContactsPage: View {
109113
.padding(.top, 12)
110114
.padding(.bottom, 16)
111115
}
112-
}
116+
}

live/Sources/Component/AudienceList/AudienceListView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class AudienceListView: RTCBaseView {
6060

6161
private var liveId: String = ""
6262
private var store: LiveAudienceStore {
63-
LiveAudienceStore.create(liveId: liveId)
63+
LiveAudienceStore.create(liveID: liveId)
6464
}
6565

6666
private var liveListStore: LiveListStore {
@@ -115,7 +115,7 @@ public class AudienceListView: RTCBaseView {
115115
guard let self = self else { return }
116116
let currentLive = liveListStore.state.value.currentLive
117117
guard !currentLive.isEmpty else { return }
118-
let audienceList = list.filter { $0.userId != currentLive.liveOwner.userId }
118+
let audienceList = list.filter { $0.userID != currentLive.liveOwner.userID }
119119
self.listUser = audienceList
120120
self.collectionView.reloadData()
121121

live/Sources/Component/AudienceList/View/AudienceListPanelView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class AudienceListPanelView: UIView {
1616

1717
private let liveId: String
1818
private var store: LiveAudienceStore {
19-
LiveAudienceStore.create(liveId: liveId)
19+
LiveAudienceStore.create(liveID: liveId)
2020
}
2121
private var liveListStore: LiveListStore {
2222
LiveListStore.shared
@@ -81,7 +81,7 @@ class AudienceListPanelView: UIView {
8181
guard let self = self else { return }
8282
let currentLive = liveListStore.state.value.currentLive
8383
guard !currentLive.isEmpty else { return }
84-
self.listUser = audienceList.filter {$0.userId != currentLive.liveOwner.userId }
84+
self.listUser = audienceList.filter {$0.userID != currentLive.liveOwner.userID }
8585
self.userListTableView.reloadData()
8686
}
8787
.store(in: &cancellableSet)

live/Sources/Component/AudienceList/View/AudienceMemberCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AudienceMemberCell: UITableViewCell {
3030
avatarImageView.image = avatarPlaceholderImage
3131
}
3232

33-
nameLabel.text = user.userName.isEmpty ? user.userId : user.userName
33+
nameLabel.text = user.userName.isEmpty ? user.userID : user.userName
3434
}
3535
}
3636

live/Sources/Component/Barrage/BarrageStreamView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ extension BarrageStreamView {
155155
}
156156

157157
var barrageStore: BarrageStore {
158-
return BarrageStore.create(liveId: liveId)
158+
return BarrageStore.create(liveID: liveId)
159159
}
160160

161161
var liveAudienceStore: LiveAudienceStore {
162-
return LiveAudienceStore.create(liveId: liveId)
162+
return LiveAudienceStore.create(liveID: liveId)
163163
}
164164
}
165165

@@ -184,7 +184,7 @@ extension BarrageStreamView {
184184
switch event {
185185
case .onAudienceJoined(audience: let audience):
186186
var barrage = Barrage()
187-
barrage.liveId = liveId
187+
barrage.liveID = liveId
188188
barrage.sender = audience
189189
barrage.textContent = " \(String.comingText)"
190190
barrage.timestampInSecond = Date().timeIntervalSince1970

live/Sources/Component/Barrage/Display/View/Cell/TUIBarrageCell.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class BarrageDefaultCell: UIView {
5656
private let barrage: Barrage
5757
private let ownerId: String
5858
private var isOwner: Bool {
59-
barrage.sender.userId == ownerId
59+
barrage.sender.userID == ownerId
6060
}
6161

6262
private let anchorButton: UIButton = {
@@ -141,8 +141,8 @@ class BarrageDefaultCell: UIView {
141141

142142
func getBarrageLabelAttributedText(barrage: Barrage) -> NSMutableAttributedString {
143143
let placeholderString = String(repeating: " ", count: isOwner ? 12 : 0)
144-
let userName = barrage.sender.userName ?? ""
145-
let displayName = (userName.isEmpty ? barrage.sender.userId : userName) + ""
144+
let userName = barrage.sender.userName
145+
let displayName = (userName.isEmpty ? barrage.sender.userID : userName) + ""
146146
let userNameAttributes: [NSAttributedString.Key: Any] =
147147
[.foregroundColor: UIColor.lightBlueColor, .font: UIFont.customFont(ofSize: 12, weight: .semibold)]
148148
let userNameAttributedText = NSMutableAttributedString(string: "\(placeholderString)\(displayName)",

live/Sources/Component/Barrage/Input/BarrageSendViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class BarrageSendViewController: UIViewController {
102102
.receive(on: RunLoop.main)
103103
.sink { [weak self] event in
104104
guard let self = self else { return }
105-
if case .onLiveEnded(liveId: let liveId, reason: _, message: _) = event,
105+
if case .onLiveEnded(liveID: let liveId, reason: _, message: _) = event,
106106
liveId == roomId {
107107
dismiss(animated: true)
108108
}
@@ -236,7 +236,7 @@ extension BarrageSendViewController: InputBarViewDelegate {
236236

237237
extension BarrageSendViewController {
238238
var barrageStore: BarrageStore {
239-
return BarrageStore.create(liveId: roomId)
239+
return BarrageStore.create(liveID: roomId)
240240
}
241241

242242
var liveListStore: LiveListStore {

live/Sources/Component/Gift/GiftListView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import TUICore
1414
public class GiftListView: UIView {
1515
private let liveId: String
1616
private var store: GiftStore {
17-
GiftStore.create(liveId: liveId)
17+
GiftStore.create(liveID: liveId)
1818
}
1919

2020
private var giftDataSource: [Gift] = []
@@ -163,7 +163,7 @@ extension GiftListView: UICollectionViewDataSource {
163163
cell.sendBlock = { [weak self, weak cell] giftInfo in
164164
if let self = self {
165165
DataReporter.reportEventData(eventKey: getReportKey())
166-
store.sendGift(giftId: giftInfo.giftId, count: 1) { [weak self] result in
166+
store.sendGift(giftID: giftInfo.giftID, count: 1) { [weak self] result in
167167
guard let self = self else { return }
168168
switch result {
169169
case .failure(let error):

live/Sources/Component/Gift/GiftPlayView.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ public class GiftPlayView: UIView {
2828

2929
private let liveId: String
3030
private var giftStore: GiftStore {
31-
GiftStore.create(liveId: liveId)
31+
GiftStore.create(liveID: liveId)
3232
}
3333

3434
private var likeStore: LikeStore {
35-
LikeStore.create(liveId: liveId)
35+
LikeStore.create(liveID: liveId)
3636
}
3737

3838
private var giftCacheKey = ""
@@ -53,7 +53,7 @@ public class GiftPlayView: UIView {
5353
let manager = TUIGiftAnimationManager(simulcastCount: 1)
5454
manager.dequeueClosure = { [weak self] giftData in
5555
guard let self = self else { return }
56-
self.giftCacheKey = giftData.giftInfo.giftId
56+
self.giftCacheKey = giftData.giftInfo.giftID
5757
self.showAdvancedAnimation(giftData: giftData)
5858
}
5959
return manager
@@ -101,7 +101,7 @@ public class GiftPlayView: UIView {
101101
.sink { [weak self] event in
102102
guard let self = self else { return }
103103
switch event {
104-
case .onReceiveGift(liveId: let liveId, gift: let gift, count: let count, sender: let sender):
104+
case .onReceiveGift(liveID: let liveId, gift: let gift, count: let count, sender: let sender):
105105
guard liveId == self.liveId else { return }
106106
delegate?.giftPlayView(self, onReceiveGift: gift, giftCount: Int(count), sender: sender)
107107
playGift(TUIGiftData(count, giftInfo: gift, sender: sender))
@@ -114,7 +114,7 @@ public class GiftPlayView: UIView {
114114
.sink { [weak self] event in
115115
guard let self = self else { return }
116116
switch event {
117-
case .onReceiveLikesMessage(liveId: let liveId, totalLikesReceived: _, sender: let sender):
117+
case .onReceiveLikesMessage(liveID: let liveId, totalLikesReceived: _, sender: let sender):
118118
guard self.liveId == liveId else { return }
119119
for i in 0 ..< 3 {
120120
let delay = Double(i) * gLikeMaxAnimationIntervalMS / 1000

0 commit comments

Comments
 (0)