From 245c1e4e4eeb1ca787e171b8e8358c6794bfde72 Mon Sep 17 00:00:00 2001 From: Kyxxn Date: Tue, 12 Nov 2024 10:51:26 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20MHBook=EC=9D=98=20=EC=BB=A8?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=84=88=20=EB=B7=B0=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MHPresentation/Source/Design/MHBook.swift | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/MemorialHouse/MHPresentation/MHPresentation/Source/Design/MHBook.swift b/MemorialHouse/MHPresentation/MHPresentation/Source/Design/MHBook.swift index 88e09451..6a2b2012 100644 --- a/MemorialHouse/MHPresentation/MHPresentation/Source/Design/MHBook.swift +++ b/MemorialHouse/MHPresentation/MHPresentation/Source/Design/MHBook.swift @@ -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 = { @@ -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) } }