Skip to content

Commit

Permalink
[Merge] #138 - 필요없는 코드 삭제 및 파일명, 변수명 변경
Browse files Browse the repository at this point in the history
필요없는 코드 삭제 및 파일명, 변수명 변경
  • Loading branch information
yeonsu0-0 authored Feb 11, 2024
2 parents e269236 + 8e6a634 commit 37610c9
Show file tree
Hide file tree
Showing 31 changed files with 336 additions and 821 deletions.
68 changes: 28 additions & 40 deletions DontBe-iOS/DontBe-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,31 @@ final class HomeCollectionViewCell: UICollectionViewCell, UICollectionViewRegist
let nicknameLabel: UILabel = {
let label = UILabel()
label.textColor = .donBlack
label.text = "Don't be야 사랑해~"
label.text = ""
label.font = .font(.body3)
return label
}()

let transparentLabel: UILabel = {
let label = UILabel()
label.textColor = .donGray9
label.text = "투명도 0%"
label.text = ""
label.font = .font(.caption4)
return label
}()

let dotLabel: UILabel = {
let label = UILabel()
label.textColor = .donGray9
label.text = "·"
label.text = ""
label.font = .font(.caption4)
return label
}()

let timeLabel: UILabel = {
let label = UILabel()
label.textColor = .donGray9
label.text = "3분 전"
label.text = ""
label.font = .font(.caption4)
return label
}()
Expand All @@ -92,7 +92,7 @@ final class HomeCollectionViewCell: UICollectionViewCell, UICollectionViewRegist
let contentTextLabel: UILabel = {
let label = UILabel()
label.textColor = .donBlack
label.text = "돈비를 사용하면 진짜 돈비를 맞을 수 있나요? 저 돈비 맞고 싶어요 돈벼락이 최고입니다."
label.text = ""
label.lineBreakMode = .byCharWrapping
label.font = .font(.body4)
label.numberOfLines = 0
Expand All @@ -116,7 +116,7 @@ final class HomeCollectionViewCell: UICollectionViewCell, UICollectionViewRegist
let likeNumLabel: UILabel = {
let label = UILabel()
label.textColor = .donGray11
label.text = "54"
label.text = ""
label.font = .font(.caption4)
return label
}()
Expand All @@ -138,7 +138,7 @@ final class HomeCollectionViewCell: UICollectionViewCell, UICollectionViewRegist
let commentNumLabel: UILabel = {
let label = UILabel()
label.textColor = .donGray11
label.text = "54"
label.text = ""
label.font = .font(.caption4)
return label
}()
Expand Down Expand Up @@ -202,7 +202,9 @@ extension HomeCollectionViewCell {
verticalTextBarView,
cellTopSpacingView)

commentStackView.addArrangedSubviews(commentButton, commentNumLabel)
commentStackView.addArrangedSubviews(commentButton,
commentNumLabel)

likeStackView.addArrangedSubviews(likeButton,
likeNumLabel)

Expand All @@ -214,9 +216,9 @@ extension HomeCollectionViewCell {

func setLayout() {
backgroundUIView.snp.makeConstraints {
$0.top.equalToSuperview().inset(8)
$0.top.equalToSuperview().inset(8.adjusted)
$0.bottom.equalToSuperview()
$0.width.equalTo(UIScreen.main.bounds.width - 32)
$0.width.equalTo(UIScreen.main.bounds.width - 32.adjusted)
}

grayView.snp.makeConstraints {
Expand Down Expand Up @@ -265,18 +267,18 @@ extension HomeCollectionViewCell {
$0.top.equalTo(contentTextLabel.snp.bottom).offset(4.adjusted)
$0.height.equalTo(commentStackView)
$0.trailing.equalTo(kebabButton).inset(8.adjusted)
$0.bottom.equalToSuperview().inset(16)
$0.bottom.equalToSuperview().inset(16.adjusted)
}

likeStackView.snp.makeConstraints {
$0.top.equalTo(commentStackView)
$0.height.equalTo(42.adjusted)
$0.trailing.equalTo(commentStackView.snp.leading).offset(-10.adjusted)
$0.bottom.equalToSuperview().inset(16)
$0.bottom.equalToSuperview().inset(16.adjusted)
}

ghostButton.snp.makeConstraints {
$0.bottom.equalToSuperview().inset(16)
$0.bottom.equalToSuperview().inset(16.adjusted)
$0.leading.equalTo(profileImageView)
$0.size.equalTo(44.adjusted)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,36 @@ import UIKit

final class DeletePopupViewController: UIViewController {

// MARK: - Properties

var contentId: Int = 0

static let popViewController = NSNotification.Name("popVC")
static let reloadData = NSNotification.Name("reloadData")
static let showWriteToastNotification = Notification.Name("ShowWriteToastNotification")
static let showDeletePostToastNotification = Notification.Name("ShowDeletePostToastNotification")

// MARK: - Properties
var contentId: Int = 0
var viewModel: DeletePostViewModel
private var cancelBag = CancelBag()

// MARK: - UI Components

private let deletePostPopupView = DontBePopupView(popupTitle: StringLiterals.Home.deletePopupTitleLabel,
popupContent: StringLiterals.Home.deletePopupContentLabel,
leftButtonTitle: StringLiterals.Home.deletePopupLefteftButtonTitle,
rightButtonTitle: StringLiterals.Home.deletePopupRightButtonTitle)

private lazy var deleteButtonTapped = deletePostPopupView.confirmButton.publisher(for: .touchUpInside).map { _ in
return self.contentId
}.eraseToAnyPublisher()
private let myView = PostPopupView()

private lazy var homeVC = HomeViewController(viewModel: HomeViewModel(networkProvider: NetworkService()))

// MARK: - Life Cycles
// MARK: - UI Components

override func loadView() {
super.loadView()
private let deletePostPopupView = DontBePopupView(popupTitle: StringLiterals.Home.deletePopupTitleLabel,
popupContent: StringLiterals.Home.deletePopupContentLabel,
leftButtonTitle: StringLiterals.Home.deletePopupLefteftButtonTitle,
rightButtonTitle: StringLiterals.Home.deletePopupRightButtonTitle)

view = myView
}

// MARK: - Life Cycles

override func viewDidLoad() {
super.viewDidLoad()

setUI()
setHierarchy()
setLayout()
setDelegate()
Expand Down Expand Up @@ -73,10 +68,6 @@ final class DeletePopupViewController: UIViewController {
// MARK: - Extensions

extension DeletePopupViewController {
private func setUI() {

}

private func setHierarchy() {
view.addSubviews(deletePostPopupView)
}
Expand Down Expand Up @@ -124,7 +115,7 @@ extension DeletePopupViewController: DontBePopupDelegate {
}

func confirmButtonTapped() {
self.homeVC.refreshPost()
self.homeVC.refreshCollectionViewDidDrag()
NotificationCenter.default.post(name: DeletePopupViewController.showDeletePostToastNotification, object: nil, userInfo: ["showDeleteToast": true])
}
}
Expand Down
Loading

0 comments on commit 37610c9

Please sign in to comment.