diff --git a/PLUV/Assets.xcassets/image/check_image.imageset/Contents.json b/PLUV/Assets.xcassets/image/ok_image.imageset/Contents.json similarity index 100% rename from PLUV/Assets.xcassets/image/check_image.imageset/Contents.json rename to PLUV/Assets.xcassets/image/ok_image.imageset/Contents.json diff --git a/PLUV/Assets.xcassets/image/check_image.imageset/check_image.png b/PLUV/Assets.xcassets/image/ok_image.imageset/check_image.png similarity index 100% rename from PLUV/Assets.xcassets/image/check_image.imageset/check_image.png rename to PLUV/Assets.xcassets/image/ok_image.imageset/check_image.png diff --git a/PLUV/Select/Cell/SelectPlaylistCollectionViewCell.swift b/PLUV/Select/Cell/SelectPlaylistCollectionViewCell.swift index f102616..ed32acf 100644 --- a/PLUV/Select/Cell/SelectPlaylistCollectionViewCell.swift +++ b/PLUV/Select/Cell/SelectPlaylistCollectionViewCell.swift @@ -11,124 +11,124 @@ import RxCocoa import Kingfisher final class SelectPlaylistCollectionViewCell: UICollectionViewCell { - - static let identifier = String(describing: SelectPlaylistCollectionViewCell.self) - - private let thumbnailImageView = UIImageView().then { - // $0.layer.cornerRadius = 8 - $0.clipsToBounds = true - } - private let playButtonImageView = UIImageView().then { - $0.image = UIImage(named: "playbutton_icon") - } - private let playlistTitleLabel = UILabel().then { - $0.textColor = .gray800 - $0.font = .systemFont(ofSize: 18, weight: .medium) - } - private let songCountLabel = UILabel().then { - $0.textColor = .gray500 - $0.font = .systemFont(ofSize: 12) - } - private let dateLabel = UILabel().then { - $0.textColor = .gray500 - $0.font = .systemFont(ofSize: 12) - } - - override init(frame: CGRect) { - super.init(frame: .zero) - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override func layoutSubviews() { - setUI() - } - - private func setUI() { - self.contentView.addSubview(thumbnailImageView) - thumbnailImageView.snp.makeConstraints { make in - make.top.leading.trailing.equalToSuperview() - make.height.equalTo(thumbnailImageView.snp.width) - } - - /* - self.thumbnailImageView.addSubview(playButtonImageView) - playButtonImageView.snp.makeConstraints { make in - make.width.equalTo(17) - make.height.equalTo(19) - make.trailing.bottom.equalToSuperview().inset(12) - } - */ - - self.contentView.addSubview(playlistTitleLabel) - playlistTitleLabel.snp.makeConstraints { make in - make.top.equalTo(thumbnailImageView.snp.bottom).offset(10) - make.leading.trailing.equalToSuperview() - make.height.equalTo(20) /// g, y, p 같은 문자 이슈로 2point 늘림 - } - - self.contentView.addSubview(songCountLabel) - songCountLabel.snp.makeConstraints { make in - make.top.equalTo(playlistTitleLabel.snp.bottom).offset(10) - make.leading.equalToSuperview() - make.height.equalTo(12) - } - - self.contentView.addSubview(dateLabel) - dateLabel.snp.makeConstraints { make in - make.top.equalTo(songCountLabel.snp.top) - make.leading.equalTo(songCountLabel.snp.trailing).offset(6) - make.height.equalTo(songCountLabel.snp.height) - } - } - - func prepare(playlist: Playlist, platform: PlatformRepresentable) { - self.dateLabel.isHidden = true - if let musicPlatform = platform as? MusicPlatform, musicPlatform == .AppleMusic { - self.songCountLabel.isHidden = true - } - - let thumbNailUrl = URL(string: playlist.thumbnailURL) - self.thumbnailImageView.kf.setImage(with: thumbNailUrl) - self.playlistTitleLabel.text = playlist.name - self.songCountLabel.text = "총 \(String(playlist.songCount ?? 0))곡" - self.dateLabel.text = "2024.04.20" - - let borderWidth: CGFloat = 2.4 - thumbnailImageView.frame = CGRectInset(self.frame, -borderWidth, -borderWidth) - thumbnailImageView.layer.borderColor = UIColor.mainPurple.cgColor - thumbnailImageView.layer.borderWidth = 0 - } - - func mePrepare(me: Me, platform: PlatformRepresentable) { - let thumbNailUrl = URL(string: me.imageURL) - self.thumbnailImageView.kf.setImage(with: thumbNailUrl) - self.playlistTitleLabel.text = me.title - self.songCountLabel.text = "총 \(me.transferredSongCount ?? 0)곡" - self.dateLabel.text = "\(me.transferredAt)" - - let borderWidth: CGFloat = 2.4 - thumbnailImageView.frame = CGRectInset(self.frame, -borderWidth, -borderWidth) - thumbnailImageView.layer.borderColor = UIColor.mainPurple.cgColor - thumbnailImageView.layer.borderWidth = 0 - } - - func savePrepare(feed: Feed, platform: PlatformRepresentable) { - let thumbNailUrl = URL(string: feed.thumbNailURL) - self.thumbnailImageView.kf.setImage(with: thumbNailUrl) - self.playlistTitleLabel.text = feed.title - self.songCountLabel.text = "총 \(feed.totalSongCount ?? 0)곡" - self.dateLabel.text = "\(feed.transferredAt)" - - let borderWidth: CGFloat = 2.4 - thumbnailImageView.frame = CGRectInset(self.frame, -borderWidth, -borderWidth) - thumbnailImageView.layer.borderColor = UIColor.mainPurple.cgColor - thumbnailImageView.layer.borderWidth = 0 - } - - func updateSelectionUI(isSelected: Bool) { - thumbnailImageView.layer.borderWidth = isSelected ? 2.4 : 0 - } + + static let identifier = String(describing: SelectPlaylistCollectionViewCell.self) + + private let thumbnailImageView = UIImageView().then { + $0.layer.cornerRadius = 8 + $0.clipsToBounds = true + } + private let playButtonImageView = UIImageView().then { + $0.image = UIImage(named: "playbutton_icon") + } + private let playlistTitleLabel = UILabel().then { + $0.textColor = .gray800 + $0.font = .systemFont(ofSize: 18, weight: .medium) + } + private let songCountLabel = UILabel().then { + $0.textColor = .gray500 + $0.font = .systemFont(ofSize: 12) + } + private let dateLabel = UILabel().then { + $0.textColor = .gray500 + $0.font = .systemFont(ofSize: 12) + } + + override init(frame: CGRect) { + super.init(frame: .zero) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func layoutSubviews() { + setUI() + } + + private func setUI() { + self.contentView.addSubview(thumbnailImageView) + thumbnailImageView.snp.makeConstraints { make in + make.top.leading.trailing.equalToSuperview() + make.height.equalTo(thumbnailImageView.snp.width) + } + + /* + self.thumbnailImageView.addSubview(playButtonImageView) + playButtonImageView.snp.makeConstraints { make in + make.width.equalTo(17) + make.height.equalTo(19) + make.trailing.bottom.equalToSuperview().inset(12) + } + */ + + self.contentView.addSubview(playlistTitleLabel) + playlistTitleLabel.snp.makeConstraints { make in + make.top.equalTo(thumbnailImageView.snp.bottom).offset(10) + make.leading.trailing.equalToSuperview() + make.height.equalTo(20) /// g, y, p 같은 문자 이슈로 2point 늘림 + } + + self.contentView.addSubview(songCountLabel) + songCountLabel.snp.makeConstraints { make in + make.top.equalTo(playlistTitleLabel.snp.bottom).offset(10) + make.leading.equalToSuperview() + make.height.equalTo(12) + } + + self.contentView.addSubview(dateLabel) + dateLabel.snp.makeConstraints { make in + make.top.equalTo(songCountLabel.snp.top) + make.leading.equalTo(songCountLabel.snp.trailing).offset(6) + make.height.equalTo(songCountLabel.snp.height) + } + } + + func prepare(playlist: Playlist, platform: PlatformRepresentable) { + self.dateLabel.isHidden = true + if let musicPlatform = platform as? MusicPlatform, musicPlatform == .AppleMusic { + self.songCountLabel.isHidden = true + } + + let thumbNailUrl = URL(string: playlist.thumbnailURL) + self.thumbnailImageView.kf.setImage(with: thumbNailUrl) + self.playlistTitleLabel.text = playlist.name + self.songCountLabel.text = "총 \(String(playlist.songCount ?? 0))곡" + self.dateLabel.text = "2024.04.20" + + let borderWidth: CGFloat = 2.4 + thumbnailImageView.frame = CGRectInset(self.frame, -borderWidth, -borderWidth) + thumbnailImageView.layer.borderColor = UIColor.mainPurple.cgColor + thumbnailImageView.layer.borderWidth = 0 + } + + func mePrepare(me: Me, platform: PlatformRepresentable) { + let thumbNailUrl = URL(string: me.imageURL) + self.thumbnailImageView.kf.setImage(with: thumbNailUrl) + self.playlistTitleLabel.text = me.title + self.songCountLabel.text = "총 \(me.transferredSongCount ?? 0)곡" + self.dateLabel.text = "\(me.transferredAt)" + + let borderWidth: CGFloat = 2.4 + thumbnailImageView.frame = CGRectInset(self.frame, -borderWidth, -borderWidth) + thumbnailImageView.layer.borderColor = UIColor.mainPurple.cgColor + thumbnailImageView.layer.borderWidth = 0 + } + + func savePrepare(feed: Feed, platform: PlatformRepresentable) { + let thumbNailUrl = URL(string: feed.thumbNailURL) + self.thumbnailImageView.kf.setImage(with: thumbNailUrl) + self.playlistTitleLabel.text = feed.title + self.songCountLabel.text = "총 \(feed.totalSongCount ?? 0)곡" + self.dateLabel.text = "\(feed.transferredAt)" + + let borderWidth: CGFloat = 2.4 + thumbnailImageView.frame = CGRectInset(self.frame, -borderWidth, -borderWidth) + thumbnailImageView.layer.borderColor = UIColor.mainPurple.cgColor + thumbnailImageView.layer.borderWidth = 0 + } + + func updateSelectionUI(isSelected: Bool) { + thumbnailImageView.layer.borderWidth = isSelected ? 2.4 : 0 + } } diff --git a/PLUV/Select/SelectMusicViewController.swift b/PLUV/Select/SelectMusicViewController.swift index 8e5fc2f..064453a 100644 --- a/PLUV/Select/SelectMusicViewController.swift +++ b/PLUV/Select/SelectMusicViewController.swift @@ -34,8 +34,8 @@ class SelectMusicViewController: UIViewController { private let selectMusicTitleView = UIView() private let sourceToDestinationLabel = UILabel().then { - $0.font = .systemFont(ofSize: 14, weight: .regular) - $0.textColor = .subBlue + $0.font = .systemFont(ofSize: 14, weight: .medium) + $0.textColor = .gray800 } private let backButton = UIButton().then { $0.setImage(UIImage(named: "xbutton_icon"), for: .normal) @@ -50,6 +50,7 @@ class SelectMusicViewController: UIViewController { private let playlistView = UIView() private let playlistThumnailImageView = UIImageView().then { $0.layer.borderColor = UIColor(white: 0, alpha: 0.1).cgColor + $0.layer.cornerRadius = 8 $0.layer.borderWidth = 0.5 $0.clipsToBounds = true } @@ -97,26 +98,20 @@ class SelectMusicViewController: UIViewController { setUI() setMusicListAPI() } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + self.navigationController?.setNavigationBarHidden(true, animated: false) + } private func setUI() { self.view.backgroundColor = .white self.navigationItem.setHidesBackButton(true, animated: false) - self.navigationController?.setNavigationBarHidden(true, animated: false) - - self.view.addSubview(scrollView) - scrollView.snp.makeConstraints { make in - make.top.bottom.leading.trailing.equalTo(view.safeAreaLayoutGuide) - } - self.scrollView.addSubview(contentView) - contentView.snp.makeConstraints { make in - make.top.bottom.leading.trailing.equalTo(view.safeAreaLayoutGuide) - } - - self.contentView.addSubview(selectMusicTitleView) + self.view.addSubview(selectMusicTitleView) selectMusicTitleView.snp.makeConstraints { make in make.top.leading.trailing.equalToSuperview() - make.height.equalTo(213) + make.height.equalTo(221) } self.selectMusicTitleView.addSubview(sourceToDestinationLabel) @@ -147,54 +142,52 @@ class SelectMusicViewController: UIViewController { playlistTitleLabel.snp.makeConstraints { make in make.top.equalTo(progressView.snp.bottom).offset(24) make.leading.trailing.equalToSuperview().inset(24) - make.bottom.equalToSuperview().inset(28) + make.height.equalTo(68) } - self.contentView.addSubview(playlistView) + self.view.addSubview(playlistView) playlistView.snp.makeConstraints { make in make.leading.trailing.equalToSuperview() - make.top.equalTo(selectMusicTitleView.snp.bottom) - make.height.equalTo(126) + make.top.equalTo(selectMusicTitleView.snp.bottom) + make.height.equalTo(110) } self.playlistView.addSubview(playlistThumnailImageView) playlistThumnailImageView.snp.makeConstraints { make in make.width.height.equalTo(86) - make.top.equalToSuperview() + make.centerY.equalToSuperview() make.leading.equalToSuperview().offset(24) } + + self.playlistView.addSubview(playlistMenuImageView) + playlistMenuImageView.snp.makeConstraints { make in + make.top.equalToSuperview().offset(14) + make.leading.equalTo(playlistThumnailImageView.snp.trailing).offset(12) + make.width.height.equalTo(20) + } + + self.playlistView.addSubview(playlistNameLabel) + playlistNameLabel.snp.makeConstraints { make in + make.leading.equalTo(playlistMenuImageView.snp.trailing).offset(4) + make.centerY.equalTo(playlistMenuImageView) + make.trailing.equalToSuperview().inset(24) + } self.playlistView.addSubview(sourcePlatformLabel) sourcePlatformLabel.snp.makeConstraints { make in - make.top.equalToSuperview().offset(3) - make.leading.equalTo(playlistThumnailImageView.snp.trailing).offset(12) + make.top.equalTo(playlistNameLabel.snp.bottom).offset(12) + make.leading.equalTo(playlistThumnailImageView.snp.trailing).offset(12) make.height.equalTo(14) - make.trailing.equalToSuperview().inset(24) - } - - self.playlistView.addSubview(playlistMenuImageView) - playlistMenuImageView.snp.makeConstraints { make in - make.top.equalTo(sourcePlatformLabel.snp.bottom).offset(10) - make.leading.equalTo(sourcePlatformLabel.snp.leading) - make.width.height.equalTo(20) - } - - self.playlistView.addSubview(playlistNameLabel) - playlistNameLabel.snp.makeConstraints { make in - make.leading.equalTo(playlistMenuImageView.snp.trailing).offset(4) - make.centerY.equalTo(playlistMenuImageView) - make.trailing.equalToSuperview().inset(24) } self.playlistView.addSubview(playlistSongCountLabel) playlistSongCountLabel.snp.makeConstraints { make in - make.leading.equalTo(sourcePlatformLabel.snp.leading) - make.bottom.equalTo(playlistThumnailImageView.snp.bottom).offset(-3) + make.top.equalTo(playlistNameLabel.snp.bottom).offset(12) + make.leading.equalTo(sourcePlatformLabel.snp.trailing).offset(4) make.height.equalTo(14) - make.trailing.equalToSuperview().inset(24) } - self.contentView.addSubview(selectSongView) + self.view.addSubview(selectSongView) selectSongView.snp.makeConstraints { make in make.top.equalTo(playlistView.snp.bottom) make.leading.trailing.equalToSuperview() @@ -222,7 +215,7 @@ class SelectMusicViewController: UIViewController { make.width.height.equalTo(16) } - self.contentView.addSubview(selectMusicTableView) + self.view.addSubview(selectMusicTableView) selectMusicTableView.snp.makeConstraints { make in make.top.equalTo(selectSongView.snp.bottom) make.leading.trailing.equalToSuperview() @@ -333,7 +326,7 @@ class SelectMusicViewController: UIViewController { private func goNextStep() { if self.searchArr.count == self.completeArr.count { - self.setValidationView(title: "플레이리스트의 모든 음악을 찾았어요!", image: "check_image") + self.setValidationView(title: "플레이리스트의 모든 음악을 찾았어요!", image: "ok_image") let movePlaylistVC = MovePlaylistViewController(musicArr: completeArr, source: self.sourcePlatform!, destination: self.destinationPlatform) movePlaylistVC.viewModel.playlistItem = viewModel.playlistItem movePlaylistVC.meViewModel.meItem = meViewModel.meItem diff --git a/PLUV/Select/SelectPlaylistViewController.swift b/PLUV/Select/SelectPlaylistViewController.swift index fce1d88..02251e6 100644 --- a/PLUV/Select/SelectPlaylistViewController.swift +++ b/PLUV/Select/SelectPlaylistViewController.swift @@ -25,7 +25,7 @@ class SelectPlaylistViewController: UIViewController { private let playlistTitleView = UIView() private let sourceToDestinationLabel = UILabel().then { - $0.font = .systemFont(ofSize: 14, weight: .regular) + $0.font = .systemFont(ofSize: 14, weight: .medium) $0.textColor = .gray800 } private let backButton = UIButton().then { @@ -81,10 +81,14 @@ class SelectPlaylistViewController: UIViewController { setCellSelected() } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + self.navigationController?.setNavigationBarHidden(true, animated: false) + } + private func setUI() { self.view.backgroundColor = .white self.navigationItem.setHidesBackButton(true, animated: false) - self.navigationController?.setNavigationBarHidden(true, animated: false) self.view.addSubview(playlistTitleView) playlistTitleView.snp.makeConstraints { make in @@ -121,18 +125,19 @@ class SelectPlaylistViewController: UIViewController { playlistTitleLabel.snp.makeConstraints { make in make.top.equalTo(progressView.snp.bottom).offset(24) make.leading.trailing.equalToSuperview().inset(24) - make.bottom.equalToSuperview().inset(28) + make.height.equalTo(34) } self.playlistTitleView.addSubview(maximumCountLabel) maximumCountLabel.snp.makeConstraints { make in - make.top.equalTo(playlistTitleView.snp.bottom).offset(12) + make.top.equalTo(playlistTitleLabel.snp.bottom).offset(6) make.leading.equalToSuperview().inset(24) + make.height.equalTo(16) } self.view.addSubview(playlistCollectionView) playlistCollectionView.snp.makeConstraints { make in - make.top.equalTo(maximumCountLabel.snp.bottom).offset(12) + make.top.equalTo(playlistTitleView.snp.bottom).offset(12) make.centerX.equalToSuperview() make.leading.trailing.equalToSuperview().inset(24) }