Skip to content

Commit

Permalink
[modify] Recent -> Me로 이름 변경 (Central-MakeUs#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaewift committed Nov 6, 2024
1 parent 1377c68 commit aca0766
Show file tree
Hide file tree
Showing 19 changed files with 403 additions and 467 deletions.
16 changes: 8 additions & 8 deletions PLUV.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
C7AC68BC2CD6101A00F7190E /* SaveSongsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7AC68BB2CD6101A00F7190E /* SaveSongsTableViewCell.swift */; };
C7AC68BE2CD6122300F7190E /* RecentDetailTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7AC68BD2CD6122300F7190E /* RecentDetailTableViewCell.swift */; };
C7AD30C02CC6787100D8007D /* RecentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7AD30BF2CC6787100D8007D /* RecentViewController.swift */; };
C7AD30C42CC685AA00D8007D /* Recent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7AD30C32CC685AA00D8007D /* Recent.swift */; };
C7BEDFE62CC6C744001F678E /* RecentViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7BEDFE52CC6C744001F678E /* RecentViewModel.swift */; };
C7AD30C42CC685AA00D8007D /* Me.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7AD30C32CC685AA00D8007D /* Me.swift */; };
C7BEDFE62CC6C744001F678E /* MeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7BEDFE52CC6C744001F678E /* MeViewModel.swift */; };
C7BF67A42CDB3B28003C9EE2 /* SimilarSongsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7BF67A32CDB3B28003C9EE2 /* SimilarSongsTableViewCell.swift */; };
C7BF67A62CDB3B3D003C9EE2 /* MoreButtonTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7BF67A52CDB3B3D003C9EE2 /* MoreButtonTableViewCell.swift */; };
C7BF67A82CDB8109003C9EE2 /* SuccessViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7BF67A72CDB8109003C9EE2 /* SuccessViewModel.swift */; };
Expand Down Expand Up @@ -229,8 +229,8 @@
C7AC68BB2CD6101A00F7190E /* SaveSongsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SaveSongsTableViewCell.swift; sourceTree = "<group>"; };
C7AC68BD2CD6122300F7190E /* RecentDetailTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentDetailTableViewCell.swift; sourceTree = "<group>"; };
C7AD30BF2CC6787100D8007D /* RecentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentViewController.swift; sourceTree = "<group>"; };
C7AD30C32CC685AA00D8007D /* Recent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Recent.swift; sourceTree = "<group>"; };
C7BEDFE52CC6C744001F678E /* RecentViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentViewModel.swift; sourceTree = "<group>"; };
C7AD30C32CC685AA00D8007D /* Me.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Me.swift; sourceTree = "<group>"; };
C7BEDFE52CC6C744001F678E /* MeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeViewModel.swift; sourceTree = "<group>"; };
C7BF67A32CDB3B28003C9EE2 /* SimilarSongsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimilarSongsTableViewCell.swift; sourceTree = "<group>"; };
C7BF67A52CDB3B3D003C9EE2 /* MoreButtonTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreButtonTableViewCell.swift; sourceTree = "<group>"; };
C7BF67A72CDB8109003C9EE2 /* SuccessViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuccessViewModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -445,7 +445,7 @@
6889F5262C6F4193001F5FC2 /* AccessTokenModel.swift */,
6889F53A2C72710F001F5FC2 /* Search.swift */,
68830FB02C82657F00995785 /* Feed.swift */,
C7AD30C32CC685AA00D8007D /* Recent.swift */,
C7AD30C32CC685AA00D8007D /* Me.swift */,
68EE372C2CB0749E0077632B /* FeedInfo.swift */,
);
path = DataModel;
Expand Down Expand Up @@ -635,7 +635,7 @@
children = (
C79AAC612CD4CE57000B5FAD /* Cell */,
C7AD30BF2CC6787100D8007D /* RecentViewController.swift */,
C7BEDFE52CC6C744001F678E /* RecentViewModel.swift */,
C7BEDFE52CC6C744001F678E /* MeViewModel.swift */,
C79E7DBB2CC85C0A00FF75F3 /* RecentDetailViewController.swift */,
C7C806FD2CCCD7F600245FEA /* RecentTabViewController.swift */,
C79E7DBD2CC87B7B00FF75F3 /* RecentSuccessViewController.swift */,
Expand Down Expand Up @@ -920,7 +920,7 @@
68DB038E2C812D0200FBD014 /* UIImage+Extension.swift in Sources */,
68F6FCFA2C5A4107001128FF /* MusicPlatform.swift in Sources */,
6889F53B2C72710F001F5FC2 /* Search.swift in Sources */,
C7AD30C42CC685AA00D8007D /* Recent.swift in Sources */,
C7AD30C42CC685AA00D8007D /* Me.swift in Sources */,
C79E7DC02CC87B8800FF75F3 /* RecentFailViewController.swift in Sources */,
C7AC68BC2CD6101A00F7190E /* SaveSongsTableViewCell.swift in Sources */,
68F6FD0A2C5D101A001128FF /* Constants.swift in Sources */,
Expand Down Expand Up @@ -969,7 +969,7 @@
C7EEA4F22CC3A59F00FBAA4D /* RecentCollectionViewCell.swift in Sources */,
C720AC662CD7313A007071BD /* PurpleProgressView.swift in Sources */,
68DC4C822C6B70C2006D8E97 /* APIService.swift in Sources */,
C7BEDFE62CC6C744001F678E /* RecentViewModel.swift in Sources */,
C7BEDFE62CC6C744001F678E /* MeViewModel.swift in Sources */,
68DC8A992C3C535300A03042 /* SceneDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
130 changes: 68 additions & 62 deletions PLUV/Component/MoveView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,66 +8,72 @@
import UIKit

final class MoveView: UIView {

var lineView = UIView()
var backButton = WhiteButton()
var trasferButton = BlackButton()

init() {
super.init(frame: .zero)
setUI()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

func setUI() {
self.backgroundColor = .white

self.addSubview(lineView)
self.lineView.backgroundColor = .gray200
lineView.snp.makeConstraints { make in
make.leading.trailing.top.equalToSuperview()
make.height.equalTo(1)
}

self.addSubview(backButton)
self.backButton.setTitle("이전", for: .normal)
backButton.snp.makeConstraints { make in
make.top.equalToSuperview().offset(11)
make.leading.equalToSuperview().offset(24)
make.height.equalTo(58)
make.width.equalTo(92)
}

self.addSubview(trasferButton)
self.trasferButton.setTitle("옮기기", for: .normal)
trasferButton.snp.makeConstraints { make in
make.top.equalTo(backButton.snp.top)
make.leading.equalTo(backButton.snp.trailing).offset(15)
make.trailing.equalToSuperview().inset(24)
make.height.equalTo(58)
}

shadow()
}

func shadow() {
self.layer.shadowColor = UIColor.shadow.cgColor
self.layer.shadowOpacity = 1
self.layer.shadowOffset = CGSize(width: 0, height: -2)
}

func changeName(left: String, right: String) {
self.backButton.removeTarget(self, action: #selector(clickBackButton), for: .touchUpInside)
self.backButton.setTitle(left, for: .normal)
self.trasferButton.setTitle(right, for: .normal)
}

@objc func clickBackButton() {
if backButton.isEnabled {
view.navigationController?.popViewController(animated: true)
}
}

var lineView = UIView()
var backButton = WhiteButton()
var trasferButton = BlackButton()
var view: UIViewController

init(view: UIViewController) {
self.view = view
super.init(frame: .zero)
setUI()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

func setUI() {
self.backgroundColor = .white

self.addSubview(lineView)
self.lineView.backgroundColor = .gray200
lineView.snp.makeConstraints { make in
make.leading.trailing.top.equalToSuperview()
make.height.equalTo(1)
}

self.addSubview(backButton)
self.backButton.setTitle("이전", for: .normal)
backButton.snp.makeConstraints { make in
make.top.equalToSuperview().offset(11)
make.leading.equalToSuperview().offset(24)
make.height.equalTo(58)
make.width.equalTo(92)
}

self.addSubview(trasferButton)
self.trasferButton.setTitle("옮기기", for: .normal)
trasferButton.snp.makeConstraints { make in
make.top.equalTo(backButton.snp.top)
make.leading.equalTo(backButton.snp.trailing).offset(15)
make.trailing.equalToSuperview().inset(24)
make.height.equalTo(58)
}

shadow()
}

func shadow() {
self.layer.shadowColor = UIColor.shadow.cgColor
self.layer.shadowOpacity = 1
self.layer.shadowOffset = CGSize(width: 0, height: -2)
}

func setBackButtonTarget(target: UIViewController) {
backButton.addTarget(target, action: #selector(target.popViewController), for: .touchUpInside)
}

func changeName(left: String, right: String) {
self.backButton.removeTarget(self, action: #selector(clickBackButton), for: .touchUpInside)
self.backButton.setTitle(left, for: .normal)
self.trasferButton.setTitle(right, for: .normal)
}

@objc func clickBackButton() {
if backButton.isEnabled {
view.navigationController?.popViewController(animated: true)
}
}
}
30 changes: 30 additions & 0 deletions PLUV/DataModel/Me.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// Me.swift
// PLUV
//
// Created by jaegu park on 10/21/24.
//

import Foundation

struct Me: Codable {
let id: Int
let transferredAt: String
let transferredSongCount: Int
let title: String
let imageURL: String

enum CodingKeys: String, CodingKey {
case id, transferredAt, transferredSongCount, title
case imageURL
}

init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.id = try container.decode(Int.self, forKey: .id)
self.transferredAt = try container.decode(String.self, forKey: .transferredAt)
self.transferredSongCount = try container.decode(Int.self, forKey: .transferredSongCount)
self.title = try container.decode(String.self, forKey: .title)
self.imageURL = try container.decode(String.self, forKey: .imageURL)
}
}
21 changes: 0 additions & 21 deletions PLUV/DataModel/Recent.swift

This file was deleted.

Loading

0 comments on commit aca0766

Please sign in to comment.