Skip to content

Commit 1779327

Browse files
author
adamsfliu
committed
【RoomKit】【iOS】 Added public properties to ViewController and View layers to address issues with Pod access.
1 parent ea1eeab commit 1779327

13 files changed

Lines changed: 81 additions & 133 deletions

application/App-UIKit/Main/UI/MainViewController.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ extension MainViewController {
146146
}
147147

148148
func gotoRoomView() {
149-
// let enterRoomVC = ConferenceOptionsViewController()
150-
// self.navigationController?.pushViewController(enterRoomVC, animated: true)
151149
let roomHomeViewController = RoomHomeViewController()
152150
self.navigationController?.pushViewController(roomHomeViewController, animated: true)
153151
}

room/Source/Base/UI/BasePanel.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import UIKit
4949
/// // - Auto-dismiss when user taps the mask area
5050
/// // - Support programmatic dismissal via dismiss(animated:completion:)
5151
/// ```
52-
protocol BasePanel: AnyObject {
52+
public protocol BasePanel: AnyObject {
5353
/// Parent view to attach the panel (usually window or view controller's view)
5454
var parentView: UIView? { get set }
5555

@@ -63,7 +63,7 @@ protocol BasePanel: AnyObject {
6363
}
6464

6565
// MARK: - Default Implementation
66-
extension BasePanel where Self: UIView {
66+
public extension BasePanel where Self: UIView {
6767
/// Show the panel with animation
6868
/// - Parameters:
6969
/// - parentView: Parent view to attach the panel
@@ -175,15 +175,15 @@ extension BasePanel where Self: UIView {
175175
}
176176

177177
// MARK: - Panel Height Provider Protocol
178-
protocol PanelHeightProvider {
178+
public protocol PanelHeightProvider {
179179
var panelHeight: CGFloat { get }
180180
}
181181

182182
// MARK: - Panel Mask View
183-
class PanelMaskView: UIView {
183+
public class PanelMaskView: UIView {
184184
var onTap: (() -> Void)?
185185

186-
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
186+
public override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
187187
let view = super.hitTest(point, with: event)
188188
return view == self ? self : nil
189189
}

room/Source/View/Main/ParticipantListView.swift

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ import Combine
1212
import AtomicXCore
1313
import Kingfisher
1414

15-
protocol ParticipantListViewDelegate: AnyObject {
15+
public protocol ParticipantListViewDelegate: AnyObject {
1616
func muteAllAudioButtonTapped(disable: Bool)
1717
func muteAllVideoButtonTapped(disable: Bool)
1818
func participantTapped(view: ParticipantListView, participant: RoomParticipant)
1919
}
2020

2121
// MARK: - ParticipantListView
22-
class ParticipantListView: UIView, BasePanel, PanelHeightProvider {
22+
public class ParticipantListView: UIView, BasePanel, PanelHeightProvider {
2323

2424
// MARK: - BasePanel Properties
25-
weak var parentView: UIView?
26-
var backgroundMaskView: PanelMaskView?
25+
weak public var parentView: UIView?
26+
public var backgroundMaskView: PanelMaskView?
2727

2828
// MARK: - PanelHeightProvider
29-
var panelHeight: CGFloat {
29+
public var panelHeight: CGFloat {
3030
return UIScreen.main.bounds.height * 0.8
3131
}
3232

33-
weak var delegate: ParticipantListViewDelegate?
33+
public weak var delegate: ParticipantListViewDelegate?
3434

3535
// MARK: - Properties
3636

@@ -109,19 +109,8 @@ class ParticipantListView: UIView, BasePanel, PanelHeightProvider {
109109
return button
110110
}()
111111

112-
// private lazy var moreButton: UIButton = {
113-
// let button = UIButton(type: .custom)
114-
// button.setTitle(.more, for: .normal)
115-
// button.setTitleColor(RoomColors.g6, for: .normal)
116-
// button.titleLabel?.font = RoomFonts.pingFangSCFont(size: 14, weight: .regular)
117-
// button.backgroundColor = RoomColors.g3
118-
// button.layer.cornerRadius = 6
119-
// button.isHidden = true
120-
// return button
121-
// }()
122-
123112
// MARK: - Initialization
124-
init(roomID: String) {
113+
public init(roomID: String) {
125114
self.roomID = roomID
126115
super.init(frame: .zero)
127116
setupViews()
@@ -145,7 +134,6 @@ class ParticipantListView: UIView, BasePanel, PanelHeightProvider {
145134

146135
bottomBarView.addSubview(muteAllAudioButton)
147136
bottomBarView.addSubview(muteAllVideoButton)
148-
// bottomBarView.addSubview(moreButton)
149137
}
150138

151139
func setupConstraints() {
@@ -182,13 +170,6 @@ class ParticipantListView: UIView, BasePanel, PanelHeightProvider {
182170
make.width.equalTo(muteAllAudioButton)
183171
make.height.equalTo(40)
184172
}
185-
//
186-
// moreButton.snp.makeConstraints { make in
187-
// make.centerY.equalTo(muteAllAudioButton)
188-
// make.right.equalToSuperview().offset(-RoomSpacing.large)
189-
// make.width.equalTo(muteAllAudioButton)
190-
// make.height.equalTo(40)
191-
// }
192173

193174
tableView.snp.makeConstraints { make in
194175
make.top.equalTo(titleLabel.snp.bottom).offset(RoomSpacing.medium)
@@ -206,7 +187,6 @@ class ParticipantListView: UIView, BasePanel, PanelHeightProvider {
206187
dropButton.addTarget(self, action: #selector(dropButtonTapped), for: .touchUpInside)
207188
muteAllAudioButton.addTarget(self, action: #selector(muteAllAudioButtonTapped), for: .touchUpInside)
208189
muteAllVideoButton.addTarget(self, action: #selector(muteAllVideoButtonTapped), for: .touchUpInside)
209-
// moreButton.addTarget(self, action: #selector(moreButtonTapped), for: .touchUpInside)
210190

211191
participantStore.state
212192
.subscribe(StatePublisherSelector(keyPath: \.participantList))
@@ -238,14 +218,12 @@ class ParticipantListView: UIView, BasePanel, PanelHeightProvider {
238218
if let currentRoom = currentRoom {
239219
muteAllAudioButton.isHidden = false
240220
muteAllVideoButton.isHidden = false
241-
// moreButton.isHidden = false
242221

243222
muteAllAudioButton.isSelected = currentRoom.isAllMicrophoneDisabled
244223
muteAllVideoButton.isSelected = currentRoom.isAllCameraDisabled
245224
} else {
246225
muteAllAudioButton.isHidden = true
247226
muteAllVideoButton.isHidden = true
248-
// moreButton.isHidden = true
249227
}
250228
}
251229
.store(in: &cancellableSet)
@@ -278,20 +256,15 @@ extension ParticipantListView {
278256
@objc private func muteAllVideoButtonTapped(sender: UIButton) {
279257
delegate?.muteAllVideoButtonTapped(disable: !sender.isSelected)
280258
}
281-
282-
@objc private func moreButtonTapped() {
283-
// TODO: Handle more action
284-
print("More button tapped")
285-
}
286259
}
287260

288261
// MARK: - UITableViewDataSource
289262
extension ParticipantListView: UITableViewDataSource {
290-
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
263+
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
291264
return allParticipants .count
292265
}
293266

294-
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
267+
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
295268
guard let cell = tableView.dequeueReusableCell(withIdentifier: ParticipantListCell.reuseIdentifier, for: indexPath) as? ParticipantListCell else {
296269
return UITableViewCell()
297270
}
@@ -305,11 +278,11 @@ extension ParticipantListView: UITableViewDataSource {
305278

306279
// MARK: - UITableViewDelegate
307280
extension ParticipantListView: UITableViewDelegate {
308-
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
281+
public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
309282
return 60
310283
}
311284

312-
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
285+
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
313286
let participant = allParticipants[indexPath.row]
314287
guard canInteractWith(participant: participant) else {
315288
return

room/Source/View/Main/ParticipantManagerView.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,30 @@ struct ParticipantActionItem {
2727
}
2828
}
2929

30-
protocol ParticipantManagerViewDelegate: AnyObject {
30+
public protocol ParticipantManagerViewDelegate: AnyObject {
3131
func handleTransferHost(view: ParticipantManagerView, participant: RoomParticipant)
3232
func handleSetAsAdmin(view: ParticipantManagerView, participant: RoomParticipant)
3333
func handleKickOut(view: ParticipantManagerView, participant: RoomParticipant)
3434
func handleInviteToOpenDevice(view: ParticipantManagerView, device: DeviceType, participant: RoomParticipant)
3535
}
3636

3737
// MARK: - ParticipantManagerView
38-
class ParticipantManagerView: UIView, BasePanel, PanelHeightProvider {
38+
public class ParticipantManagerView: UIView, BasePanel, PanelHeightProvider {
3939

4040
// MARK: - BasePanel Properties
41-
weak var parentView: UIView?
42-
var backgroundMaskView: PanelMaskView?
41+
weak public var parentView: UIView?
42+
public var backgroundMaskView: PanelMaskView?
4343

4444
// MARK: - PanelHeightProvider
45-
var panelHeight: CGFloat {
45+
public var panelHeight: CGFloat {
4646
let headerHeight: CGFloat = 100
4747
let itemHeight: CGFloat = 56
4848
let totalItemsHeight = CGFloat(actionItems.count) * itemHeight
4949
let bottomSafeArea = UIApplication.shared.windows.first?.safeAreaInsets.bottom ?? 0
5050
return headerHeight + totalItemsHeight + bottomSafeArea + 20
5151
}
5252

53-
weak var delegate: ParticipantManagerViewDelegate?
53+
public weak var delegate: ParticipantManagerViewDelegate?
5454

5555
// MARK: - Properties
5656
private var participant: RoomParticipant
@@ -106,7 +106,7 @@ class ParticipantManagerView: UIView, BasePanel, PanelHeightProvider {
106106
}()
107107

108108
// MARK: - Initialization
109-
init(participant: RoomParticipant, roomID: String) {
109+
public init(participant: RoomParticipant, roomID: String) {
110110
self.participant = participant
111111
self.roomID = roomID
112112
super.init(frame: .zero)
@@ -346,11 +346,11 @@ extension ParticipantManagerView {
346346

347347
// MARK: - UITableViewDataSource
348348
extension ParticipantManagerView: UITableViewDataSource {
349-
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
349+
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
350350
return actionItems.count
351351
}
352352

353-
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
353+
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
354354
guard let cell = tableView.dequeueReusableCell(withIdentifier: ParticipantManagerCell.reuseIdentifier, for: indexPath) as? ParticipantManagerCell else {
355355
return UITableViewCell()
356356
}
@@ -364,11 +364,11 @@ extension ParticipantManagerView: UITableViewDataSource {
364364

365365
// MARK: - UITableViewDelegate
366366
extension ParticipantManagerView: UITableViewDelegate {
367-
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
367+
public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
368368
return 56
369369
}
370370

371-
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
371+
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
372372
tableView.deselectRow(at: indexPath, animated: true)
373373
let item = actionItems[indexPath.row]
374374
item.action()
@@ -377,7 +377,7 @@ extension ParticipantManagerView: UITableViewDelegate {
377377

378378
// MARK: - RoomChangeNicknameViewDelegate
379379
extension ParticipantManagerView: RoomChangeNicknameViewDelegate {
380-
func changeNickname(view: RoomChangeNicknameView, didConfirmName name: String) {
380+
public func changeNickname(view: RoomChangeNicknameView, didConfirmName name: String) {
381381
participantStore.updateParticipantNameCard(userID: participant.userID, nameCard: name) { [weak self] result in
382382
guard let self = self else { return }
383383
switch result {

room/Source/View/Main/RoomBottomBarView.swift

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,19 @@
99
import AtomicXCore
1010
import Combine
1111

12-
protocol RoomBottomBarViewDelegate: AnyObject {
12+
public protocol RoomBottomBarViewDelegate: AnyObject {
1313
func onMembersButtonTapped()
1414
func onMicrophoneButtonTapped()
1515
func onCameraButtonTapped()
16-
// func onMoreButtonTapped()
1716
}
1817

1918
// MARK: - RoomBottomBarView Component
20-
class RoomBottomBarView: UIView, BaseView {
19+
public class RoomBottomBarView: UIView, BaseView {
2120
// MARK: - BaseView Properties
2221
weak var routerContext: RouterContext?
2322

2423
// MARK: - Properties
25-
weak var delegate: RoomBottomBarViewDelegate?
24+
public weak var delegate: RoomBottomBarViewDelegate?
2625

2726
private let deviceStore: DeviceStore = DeviceStore.shared
2827
private let roomStore: RoomStore = RoomStore.shared
@@ -80,20 +79,10 @@ class RoomBottomBarView: UIView, BaseView {
8079
return button
8180
}()
8281

83-
// private lazy var moreButton: RoomIconButton = {
84-
// let button = RoomIconButton()
85-
// button.setIcon(ResourceLoader.loadImage("room_more"))
86-
// button.setTitle("Expansion".localized)
87-
// button.setIconPosition(.top, spacing: RoomSpacing.extraSmall)
88-
// button.setTitleColor(.white)
89-
// button.setTitleFont(RoomFonts.pingFangSCFont(size: 10, weight: .regular))
90-
// return button
91-
// }()
92-
9382
private lazy var buttons: [RoomIconButton] = {[membersButton, microphoneButton, cameraButton]}()
9483

9584
// MARK: - Initialization
96-
init(roomID: String) {
85+
public init(roomID: String) {
9786
self.roomID = roomID
9887
super.init(frame: .zero)
9988
setupViews()
@@ -143,7 +132,6 @@ class RoomBottomBarView: UIView, BaseView {
143132
membersButton.addTarget(self, action: #selector(membersButtonTapped), for: .touchUpInside)
144133
microphoneButton.addTarget(self, action: #selector(microphoneButtonTapped), for: .touchUpInside)
145134
cameraButton.addTarget(self, action: #selector(cameraButtonTapped), for: .touchUpInside)
146-
// moreButton.addTarget(self, action: #selector(moreButtonTapped(sender:)), for: .touchUpInside)
147135

148136
participantStore.state.subscribe(StatePublisherSelector(keyPath: \.localParticipant))
149137
.combineLatest(roomStore.state.subscribe(StatePublisherSelector(keyPath: \.currentRoom)))
@@ -222,10 +210,6 @@ extension RoomBottomBarView {
222210
@objc private func cameraButtonTapped() {
223211
delegate?.onCameraButtonTapped()
224212
}
225-
226-
// @objc private func moreButtonTapped() {
227-
// delegate?.onMoreButtonTapped()
228-
// }
229213
}
230214

231215
fileprivate extension String {

0 commit comments

Comments
 (0)