@@ -15,16 +15,14 @@ import Kingfisher
1515public class RoomHomeView : UIView , BaseView {
1616
1717 // MARK: - Properties
18- weak var routerContext : RouterContext ?
18+ public weak var routerContext : RouterContext ?
1919 private let roomStore : RoomStore = RoomStore . shared
2020 private var cancellableSet = Set < AnyCancellable > ( )
2121
2222 // MARK: - UI Components
2323 private lazy var backButtonContainerView : UIView = {
2424 let view = UIView ( )
2525 view. backgroundColor = . clear
26- let tapGesture = UITapGestureRecognizer ( target: self , action: #selector( handleBackButtonTapped) )
27- view. addGestureRecognizer ( tapGesture)
2826 view. isUserInteractionEnabled = true
2927 return view
3028 } ( )
@@ -38,8 +36,6 @@ public class RoomHomeView: UIView, BaseView {
3836
3937 private lazy var userAvatarContainerView : UIView = {
4038 let view = UIView ( )
41- let tapGesture = UITapGestureRecognizer ( target: self , action: #selector( handleUserAvatarTapped) )
42- view. addGestureRecognizer ( tapGesture)
4339 view. isUserInteractionEnabled = true
4440 return view
4541 } ( )
@@ -65,7 +61,6 @@ public class RoomHomeView: UIView, BaseView {
6561 title: . joinRoom,
6662 iconName: " join_room "
6763 )
68- button. addTarget ( self , action: #selector( handleJoinRoomButtonTapped) , for: . touchUpInside)
6964 return button
7065 } ( )
7166
@@ -74,7 +69,6 @@ public class RoomHomeView: UIView, BaseView {
7469 title: . createRoom,
7570 iconName: " create_room "
7671 )
77- button. addTarget ( self , action: #selector( handleCreateRoomButtonTapped) , for: . touchUpInside)
7872 return button
7973 } ( )
8074
@@ -95,7 +89,7 @@ public class RoomHomeView: UIView, BaseView {
9589
9690 // MARK: - BaseView Implementation
9791
98- func setupViews( ) {
92+ public func setupViews( ) {
9993 addSubview ( backButtonContainerView)
10094 backButtonContainerView. addSubview ( backButton)
10195 backButtonContainerView. addSubview ( userAvatarContainerView)
@@ -105,7 +99,7 @@ public class RoomHomeView: UIView, BaseView {
10599 addSubview ( createRoomButton)
106100 }
107101
108- func setupConstraints( ) {
102+ public func setupConstraints( ) {
109103 backButtonContainerView. snp. makeConstraints { make in
110104 make. left. equalToSuperview ( )
111105 make. top. equalTo ( safeAreaLayoutGuide. snp. top)
@@ -153,10 +147,21 @@ public class RoomHomeView: UIView, BaseView {
153147 }
154148 }
155149
156- func setupStyles( ) {
150+ public func setupStyles( ) {
157151 backgroundColor = RoomColors . themeBackground
158152 }
159153
154+ public func setupBindings( ) {
155+ let tapGesture = UITapGestureRecognizer ( target: self , action: #selector( handleBackButtonTapped) )
156+ backButtonContainerView. addGestureRecognizer ( tapGesture)
157+
158+ let userAvatarTapGesture = UITapGestureRecognizer ( target: self , action: #selector( handleUserAvatarTapped) )
159+ userAvatarContainerView. addGestureRecognizer ( userAvatarTapGesture)
160+
161+ createRoomButton. addTarget ( self , action: #selector( handleCreateRoomButtonTapped) , for: . touchUpInside)
162+ joinRoomButton. addTarget ( self , action: #selector( handleJoinRoomButtonTapped) , for: . touchUpInside)
163+ }
164+
160165 // MARK: - Helper Methods
161166
162167 private func createActionButton( title: String , iconName: String ) -> UIButton {
0 commit comments