Skip to content

Commit

Permalink
refactor: MHBook의 컨테이너 뷰 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyxxn committed Nov 12, 2024
1 parent 6bbb91e commit 245c1e4
Showing 1 changed file with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ extension BookType {

final class MHBook: UIView {
// MARK: - Property
private let containerView = UIView()
private let bookImageView = UIImageView()
private let titleLabel = UILabel(style: .default)
private let targetImageView: UIImageView = {
Expand Down Expand Up @@ -60,22 +59,20 @@ final class MHBook: UIView {
}

private func configureAddSubView() {
addSubview(containerView)
containerView.addSubview(bookImageView)
containerView.addSubview(titleLabel)
containerView.addSubview(targetImageView)
containerView.addSubview(publisherLabel)
addSubview(bookImageView)
addSubview(titleLabel)
addSubview(targetImageView)
addSubview(publisherLabel)
}

private func configureConstraints() {
containerView.fillSuperview()
bookImageView.fillSuperview()
titleLabel.setTop(anchor: containerView.topAnchor, constant: 16)
titleLabel.setCenterX(view: containerView, constant: 8)
titleLabel.setTop(anchor: topAnchor, constant: 16)
titleLabel.setCenterX(view: self, constant: 8)
targetImageView.setTop(anchor: titleLabel.bottomAnchor, constant: 14)
targetImageView.setCenterX(view: containerView, constant: 8)
targetImageView.setCenterX(view: self, constant: 8)
targetImageView.setWidthAndHeight(width: 100, height: 100)
publisherLabel.setBottom(anchor: containerView.bottomAnchor, constant: 12)
publisherLabel.setTrailing(anchor: containerView.trailingAnchor, constant: 12)
publisherLabel.setBottom(anchor: bottomAnchor, constant: 12)
publisherLabel.setTrailing(anchor: trailingAnchor, constant: 12)
}
}

0 comments on commit 245c1e4

Please sign in to comment.