From 370f90e5b633b9a9545038e3571d33f6b6852d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=86=B7=E1=84=8C=E1=85=AE=E1=84=86?= =?UTF-8?q?=E1=85=B5=E1=86=AB?= Date: Thu, 19 Jan 2023 23:16:49 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8[FEAT]=20#146=20-=20=EC=BD=9C=EB=A0=89?= =?UTF-8?q?=EC=85=98=EB=B7=B0=20=EC=85=80=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LikedStudiosCollectionViewCell.swift | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 Fillin-iOS/Fillin-iOS/Sources/ViewControllers/MyPageViewController/likedStudiosViewController/LikedStudiosCollectionViewCell.swift diff --git a/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/MyPageViewController/likedStudiosViewController/LikedStudiosCollectionViewCell.swift b/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/MyPageViewController/likedStudiosViewController/LikedStudiosCollectionViewCell.swift new file mode 100644 index 0000000..6ec3476 --- /dev/null +++ b/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/MyPageViewController/likedStudiosViewController/LikedStudiosCollectionViewCell.swift @@ -0,0 +1,88 @@ +// +// LikedStudiosCollectionViewCell.swift +// Fillin-iOS +// +// Created by 임주민 on 2023/01/19. +// + +import UIKit + +import SnapKit +import Then + +final class LikedStudiosCollectionViewCell: UICollectionViewCell { + // MARK: - Property + static let identifier = "LikedStudiosCollectionViewCell" + + // MARK: - UI Property + private let markerImageView = UIImageView().then { + $0.image = Asset.icnPlaceSmall.image + } + + private let nameLabel = UILabel().then { + $0.textColor = .white + $0.font = .subhead3 + } + + private let addressLabel = UILabel().then { + $0.textColor = .grey1 + $0.font = .body1 + } + + private let scrapButton = UIButton().then { + $0.setImage(Asset.btnScrapActive.image, for: .normal) + } + + private let borderLineView = UIView().then { + $0.backgroundColor = .darkGrey1 + } + + // MARK: - Life Cycle + override init(frame: CGRect) { + super.init(frame: frame) + + setLayout() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - Custom Method + + private func setLayout() { + addSubviews([markerImageView, nameLabel, addressLabel, scrapButton, borderLineView]) + + markerImageView.snp.makeConstraints { + $0.top.leading.equalToSuperview().inset(14) + $0.width.height.equalTo(22) + } + + nameLabel.snp.makeConstraints { + $0.centerY.equalTo(markerImageView) + $0.leading.equalTo(markerImageView.snp.trailing).offset(7) + } + + addressLabel.snp.makeConstraints { + $0.top.equalTo(nameLabel.snp.bottom).offset(7) + $0.leading.equalTo(nameLabel.snp.leading) + $0.trailing.equalTo(scrapButton.snp.leading).offset(-12) + } + + scrapButton.snp.makeConstraints { + $0.centerY.equalTo(markerImageView) + $0.trailing.equalToSuperview().inset(16) + $0.width.height.equalTo(32) + } + + borderLineView.snp.makeConstraints { + $0.leading.bottom.trailing.equalToSuperview() + $0.height.equalTo(1) + } + } + + func setData(studioName: String, studioAddress: String) { + nameLabel.text = studioName + addressLabel.text = studioAddress + } +}