Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ”€ :: (#492) PlaylistDetail์„ ReactorKit์œผ๋กœ ๋ฆฌํŒฉํ•ฉ๋‹ˆ๋‹ค. #514

Merged
merged 37 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d5ab291
:recycle: :: playlistHeader๋ฅผ Model๋กœ ์ด์ „
yongbeomkwak Apr 17, 2024
9ea0155
:zap: :: ๋ฆฌ์—‘ํ„ฐํ‚ท์œผ๋กœ ๋ฆฌํŒฉ ์‹œ์ž‘
yongbeomkwak Apr 17, 2024
354e3d8
:zap: :: ํฌ๋งทํŒ…
yongbeomkwak Apr 17, 2024
9553749
:lipstick: :: ํ—ค๋” ์ •๋ณด ์‚ฝ์ž…
yongbeomkwak Apr 20, 2024
3e832a1
:zap: :: ํฌ๋งทํŒ…
yongbeomkwak Apr 20, 2024
3305697
:recycle: :: songCart show/hide ๊ฐœ์„ 
yongbeomkwak May 3, 2024
0024da5
:recycle: :: ๋ชจ๋“  ๊ณก ์„ ํƒ/ํ•ด์ œ
yongbeomkwak May 3, 2024
03bc28e
:recycle: :: ํŽธ์ง‘๋ชจ๋“œ ์ง„์ž…
yongbeomkwak May 3, 2024
55b1dcf
:recylcle: :: undo ๊ฐœ์„ 
yongbeomkwak May 3, 2024
6cecdc2
:recycle: :: ์•„์ดํ…œ ์˜ฎ๊น€ ์ด๋ฒคํŠธ
yongbeomkwak May 3, 2024
1606e68
:bricks: :: ๋งˆ๋ฌด๋ฆฌ ์ž‘์—…
yongbeomkwak May 3, 2024
de19920
:bricks: :: ์Šค์œ„ํ”„ํŠธ ํฌ๋งท
yongbeomkwak May 3, 2024
51c7706
:zap: ::ํ”Œ๋ ˆ์ด๋ฆฌ์ŠคํŠธ ์ด๋ฆ„ ์ˆ˜์ • ์ด๋ฒคํŠธ ์—ฐ๊ฒฐ
yongbeomkwak May 3, 2024
4d1764b
:bricks: :: ํฌ๋งทํŒ…
yongbeomkwak May 3, 2024
a97ef02
:truck: :: header rename to headerModel
yongbeomkwak May 3, 2024
1511a98
:truck: :: ๋ณ€์ˆ˜ ๋ฐ ํŒŒ๋ผ๋ฏธํ„ฐ ๋ช…์‹œ
yongbeomkwak May 3, 2024
5e116c0
:poop: subscribe -> bind
yongbeomkwak May 3, 2024
de09e72
:poop: :: ์ธ๋ฑ์Šค ์ ‘๊ทผ์— ๋Œ€ํ•œ ์•ˆ์ „์ฝ”๋“œ
yongbeomkwak May 3, 2024
7971b12
:poop: :: ์ค„๋ฐ”๊ฟˆ
yongbeomkwak May 3, 2024
f9fcb28
:bricks: :: ํฌ๋งทํŒ…
yongbeomkwak May 3, 2024
b16c43b
Update Projects/Features/PlaylistFeature/Sources/Reactors/PlaylistDetโ€ฆ
yongbeomkwak May 3, 2024
d9415cc
:zap: internal ์ฒ˜๋ฆฌ
yongbeomkwak May 3, 2024
71755f6
:bricks: ํฌ๋งทํŒ…
yongbeomkwak May 3, 2024
0a1a3ec
:zap: :: ๋ฐ˜๋ณต๋˜๋Š” ๊ฒƒ mutate๋กœ ๋” ์ž์„ธํžˆ ๋‚˜๋ˆ„๊ธฐ
yongbeomkwak May 3, 2024
32d10ca
:zap: :: ์ €์žฅ ๊ธฐ๋Šฅ ์—ฐ๊ฒฐ
yongbeomkwak May 3, 2024
51ae95d
:bricks: :: ํฌ๋งทํŒ…
yongbeomkwak May 3, 2024
a76ad8c
:bug: :: ์™€์šฐ .. self ์บก์ณ ์•ˆํ•ด์„œ ๋ฉ”๋ชจ๋ฆฌ ๋ˆ„์ˆ˜ ๋‚ ๋ป” .ใ…Žใ…Ž
yongbeomkwak May 4, 2024
ea5ec6d
:bricks: :: ํฌ๋งทํŒ…
yongbeomkwak May 4, 2024
40d7e32
:zap: :: ๋กœ๊น…
yongbeomkwak May 4, 2024
893d8df
:bricks: :: ํฌ๋งทํŒ…
yongbeomkwak May 4, 2024
44d32b8
:poop: :: ์ค„๋ฐ”๊ฟˆ ์ œ๊ฑฐ
yongbeomkwak May 4, 2024
fd70dae
:bricks: :: ํฌ๋งทํŒ…
yongbeomkwak May 4, 2024
4a013dd
:poop: :: ์ฝ”๋“œ ๊ฐ€๋…์„ฑ ์ฆ์ง„
yongbeomkwak May 4, 2024
c72bf34
:bricks: :: ํฌ๋งทํŒ…
yongbeomkwak May 4, 2024
bef3cf8
Update Projects/Features/PlaylistFeature/Sources/ViewControllers/Playโ€ฆ
yongbeomkwak May 4, 2024
4efd213
Update Projects/Features/PlaylistFeature/Sources/ViewControllers/Playโ€ฆ
yongbeomkwak May 4, 2024
7868c2c
Update Projects/Features/PlaylistFeature/Sources/ViewControllers/Playโ€ฆ
yongbeomkwak May 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ extension ArtistDetailHeaderViewController {
)

self.artistNameLabelHeight.constant =
(availableWidth >= artistNameWidth) ? 36 :
ceil(artistNameAttributedString.height(containerWidth: availableWidth))
(availableWidth >= artistNameWidth) ? 36 :
ceil(artistNameAttributedString.height(containerWidth: availableWidth))

self.artistNameLabel.attributedText = artistNameAttributedString

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ extension ArtistMusicContentViewController: UITableViewDelegate {
}

extension ArtistMusicContentViewController: PlayButtonGroupViewDelegate {
public func pressPlay(_ event: PlayEvent) {
public func play(_ event: PlayEvent) {
let songs: [SongEntity] = output.dataSource.value.map {
return SongEntity(
id: $0.songId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public class ArtistPlayButtonGroupView: UIView {
}

@IBAction func allPlayButtonAction(_ sender: Any) {
delegate?.pressPlay(.allPlay)
delegate?.play(.allPlay)
}

@IBAction func shufflePlayButtonAction(_ sender: Any) {
delegate?.pressPlay(.shufflePlay)
delegate?.play(.shufflePlay)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ open class BaseStoryboardReactorViewController<R: Reactor>: UIViewController, St
ViewControllerFromStoryBoard {
public var disposeBag = DisposeBag()

@available(*, unavailable)
public required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
// @available(*, unavailable)
// public required init?(coder: NSCoder) {
// fatalError("init(coder:) has not been implemented")
// }

override open func viewDidLoad() {
super.viewDidLoad()
configureUI()
configureNavigation()
}

public func bind(reactor: R) {
open func bind(reactor: R) {
bindState(reactor: reactor)
bindAction(reactor: reactor)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public enum PlayEvent {
}

public protocol PlayButtonGroupViewDelegate: AnyObject {
func pressPlay(_ event: PlayEvent)
func play(_ event: PlayEvent)
}

public class PlayButtonGroupView: UIView {
Expand All @@ -28,11 +28,11 @@ public class PlayButtonGroupView: UIView {
public weak var delegate: PlayButtonGroupViewDelegate?

@IBAction func pressAllPlay(_ sender: UIButton) {
delegate?.pressPlay(.allPlay)
delegate?.play(.allPlay)
}

@IBAction func pressSufflePlay(_ sender: UIButton) {
delegate?.pressPlay(.shufflePlay)
delegate?.play(.shufflePlay)
}

override public init(frame: CGRect) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ extension NewSongsContentViewController: UITableViewDelegate {
}

extension NewSongsContentViewController: PlayButtonGroupViewDelegate {
public func pressPlay(_ event: PlayEvent) {
public func play(_ event: PlayEvent) {
input.groupPlayTapped.onNext(event)
}
}
Expand Down
12 changes: 0 additions & 12 deletions Projects/Features/PlaylistFeature/Resources/Playlist.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="back"/>
<connections>
<action selector="backButtonAction:" destination="SM8-hg-XhK" eventType="touchUpInside" id="oMy-nn-z6W"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ํŽธ์ง‘" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6wo-Du-OzR">
<rect key="frame" x="181.66666666666666" y="13.999999999999998" width="29.666666666666657" height="20.333333333333329"/>
Expand All @@ -41,9 +38,6 @@
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8gm-5T-7GB">
<rect key="frame" x="343" y="7" width="30" height="34"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<connections>
<action selector="pressEditListAction:" destination="SM8-hg-XhK" eventType="touchUpInside" id="dqF-sp-TNY"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="a9D-Xe-d3o">
<rect key="frame" x="328" y="7" width="45" height="34"/>
Expand All @@ -54,9 +48,6 @@
<state key="normal" title="์™„๋ฃŒ">
<color key="titleColor" name="POINT"/>
</state>
<connections>
<action selector="pressCompleteAction:" destination="SM8-hg-XhK" eventType="touchUpInside" id="uMK-e5-uvn"/>
</connections>
</button>
</subviews>
<constraints>
Expand Down Expand Up @@ -106,9 +97,6 @@
<constraint firstAttribute="height" constant="24" id="qMZ-vr-bqk"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<connections>
<action selector="pressEditNameAction:" destination="SM8-hg-XhK" eventType="touchUpInside" id="q3k-hz-L8X"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="0.98823529409999999" green="0.98823529409999999" blue="0.99215686270000003" alpha="0.40000000000000002" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public protocol PlayListDetailDependency: Dependency {
public final class PlayListDetailComponent: Component<PlayListDetailDependency>, PlaylistDetailFactory {
public func makeView(id: String, isCustom: Bool) -> UIViewController {
return PlayListDetailViewController.viewController(
viewModel: PlayListDetailViewModel(
id: id,
reactor: PlaylistDetailReactor(
key: id,
type: isCustom ? .custom : .wmRecommend,
fetchPlayListDetailUseCase: dependency.fetchPlayListDetailUseCase,
editPlayListUseCase: dependency.editPlayListUseCase,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Foundation

public struct PlayListHeaderModel {
var title: String
var songCount: String
var image: String
var version: Int
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Foundation

public struct PlaylistMetaData {
let list: [PlayListDetailSectionModel]
let header: PlayListHeaderModel
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ import RxSwift
import SongsDomainInterface
import Utility

struct PlayListHeaderInfo {
var title: String
var songCount: String
var image: String
var version: Int
}

public final class PlayListDetailViewModel: ViewModelType {
var type: PlayListType!
var id: String!
Expand All @@ -36,7 +29,6 @@ public final class PlayListDetailViewModel: ViewModelType {
var disposeBag = DisposeBag()

public struct Input {
let textString: BehaviorRelay<String> = BehaviorRelay(value: "")
let itemMoved: PublishSubject<ItemMovedEvent> = PublishSubject()
let playListNameLoad: BehaviorRelay<String> = BehaviorRelay(value: "")
let cancelEdit: PublishSubject<Void> = PublishSubject()
Expand All @@ -49,7 +41,7 @@ public final class PlayListDetailViewModel: ViewModelType {
}

public struct Output {
let headerInfo: PublishRelay<PlayListHeaderInfo> = PublishRelay()
let headerInfo: PublishRelay<PlayListHeaderModel> = PublishRelay()
let dataSource: BehaviorRelay<[PlayListDetailSectionModel]> = BehaviorRelay(value: [])
let backUpdataSource: BehaviorRelay<[PlayListDetailSectionModel]> = BehaviorRelay(value: [])
let indexOfSelectedSongs: BehaviorRelay<[Int]> = BehaviorRelay(value: [])
Expand Down Expand Up @@ -104,7 +96,7 @@ public final class PlayListDetailViewModel: ViewModelType {
.do(onNext: { [weak self] model in
guard let self = self else { return }
output.headerInfo.accept(
PlayListHeaderInfo(
PlayListHeaderModel(
title: model.title,
songCount: "\(model.songs.count)๊ณก",
image: self.type == .wmRecommend ?
Expand All @@ -122,7 +114,7 @@ public final class PlayListDetailViewModel: ViewModelType {
input.playListNameLoad
.skip(1)
.withLatestFrom(output.headerInfo) { ($0, $1) }
.map { PlayListHeaderInfo(title: $0.0, songCount: $0.1.songCount, image: $0.1.image, version: $0.1.version)
.map { PlayListHeaderModel(title: $0.0, songCount: $0.1.songCount, image: $0.1.image, version: $0.1.version)
}
baekteun marked this conversation as resolved.
Show resolved Hide resolved
.bind(to: output.headerInfo)
.disposed(by: disposeBag)
Expand Down
Loading
Loading