Skip to content

Commit

Permalink
#296: 마이페이지의 필터링 클릭 시, 빈화면의 지역필터링 모달 띄움 (나머지 지역필터링 UI 추가 예정)
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph704 committed Jul 30, 2024
1 parent 708785e commit 59e047d
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// RegionFilteringModalViewController.swift
// StreetDrop
//
// Created by 차요셉 on 7/30/24.
//

import UIKit

import SnapKit
import RxSwift

final class RegionFilteringModalViewController: UIViewController, ModalPresentable {
var upperMarginHeight: CGFloat = 158
var containerViewTopConstraint: Constraint?
let disposeBag: DisposeBag = .init()

let modalContainerView: UIView = {
let view: UIView = .init()
view.backgroundColor = .gray800

return view
}()

override func viewDidLoad() {
super.viewDidLoad()
setupModal()
configureUI()
}
}

private extension RegionFilteringModalViewController {
func configureUI() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ final class MyPageViewController: UIViewController, Toastable, Alertable {
private let disposeBag = DisposeBag()
private let totalMusicsCountRelay: ReplayRelay<Int> = .create(bufferSize: 1)
private let selectedFilterType: BehaviorRelay<FilterType> = .init(value: .newest)
private let regionFilterButtonClickEvent: PublishRelay<Void> = .init()

// MARK: - Init

Expand Down Expand Up @@ -371,6 +372,9 @@ private extension MyPageViewController {
tapListView.updateTapListUI(by: type)

let musicListFilterView: MusicListFilterView = .init()
musicListFilterView.regionFilterButtonClickEvent
.bind(to: regionFilterButtonClickEvent)
.disposed(by: disposeBag)

let separatorView = UIView()
separatorView.backgroundColor = .gray600
Expand Down Expand Up @@ -525,6 +529,16 @@ private extension MyPageViewController {
owner.handleScrollEvent(contentOffset: state.contentOffset, type: state.type)
}
.disposed(by: disposeBag)

regionFilterButtonClickEvent
.bind(with: self) { owner, _ in
let regionFilteringModalViewController = RegionFilteringModalViewController()
regionFilteringModalViewController.modalPresentationStyle = .overFullScreen
owner.present(regionFilteringModalViewController, animated: false) {
regionFilteringModalViewController.animatePresentation()
}
}
.disposed(by: disposeBag)
}

func bindViewModel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
import UIKit

import RxSwift
import RxRelay

final class MusicListFilterView: UIView {
private let regionFilterButtonClickEventRelay: PublishRelay<Void> = .init()
var regionFilterButtonClickEvent: Observable<Void> {
regionFilterButtonClickEventRelay.asObservable()
}
private let disposeBag: DisposeBag = .init()

fileprivate let musicCountLabel: UILabel = {
let label = UILabel()
Expand Down Expand Up @@ -52,7 +58,7 @@ final class MusicListFilterView: UIView {

override init(frame: CGRect) {
super.init(frame: frame)

bindAction()
configureUI()
}

Expand All @@ -65,6 +71,12 @@ final class MusicListFilterView: UIView {
// MARK: - Private Methods

private extension MusicListFilterView {
func bindAction() {
regionFilterButton.rx.tap
.bind(to: regionFilterButtonClickEventRelay)
.disposed(by: disposeBag)
}

func configureUI() {
backgroundColor = .gray900

Expand Down

0 comments on commit 59e047d

Please sign in to comment.