From 9c768a31a67051b9389516fa56fa1e3b98ecc1e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EC=B1=84=EC=9D=80?= Date: Wed, 25 Oct 2023 14:31:06 +0900 Subject: [PATCH] =?UTF-8?q?Refactor=20[#269]=20=ED=83=80=EC=9E=84=EB=9D=BC?= =?UTF-8?q?=EC=9D=B8=20=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Around/Cell/AroundSkeletonTableViewCell.swift | 4 ---- .../Around/Cell/AroundTableViewCell.swift | 1 - .../Presentation/Around/View/AroundView.swift | 11 +++++++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/YELLO-iOS/YELLO-iOS/Presentation/Around/Cell/AroundSkeletonTableViewCell.swift b/YELLO-iOS/YELLO-iOS/Presentation/Around/Cell/AroundSkeletonTableViewCell.swift index 1c47c788..d9db88d6 100644 --- a/YELLO-iOS/YELLO-iOS/Presentation/Around/Cell/AroundSkeletonTableViewCell.swift +++ b/YELLO-iOS/YELLO-iOS/Presentation/Around/Cell/AroundSkeletonTableViewCell.swift @@ -39,7 +39,6 @@ final class AroundSkeletonTableViewCell: UITableViewCell { override func layoutSubviews() { super.layoutSubviews() - contentView.frame = contentView.frame.inset(by: UIEdgeInsets(top: 0, left: 0, bottom: 8.adjustedHeight, right: 0)) } @@ -91,9 +90,6 @@ final class AroundSkeletonTableViewCell: UITableViewCell { } private func setLayout() { - - // 데이터 어떻게 들어오는지에 따라서 변경 예정 - // let maxKeywordLength = votingList[VotingViewController.pushCount].keywordList.compactMap { $0.count }.max() ?? 0 let keywordLength = (keywordLabel.text?.count ?? 0 * 14).adjusted + 28.adjusted contentView.addSubviews(genderImageView, diff --git a/YELLO-iOS/YELLO-iOS/Presentation/Around/Cell/AroundTableViewCell.swift b/YELLO-iOS/YELLO-iOS/Presentation/Around/Cell/AroundTableViewCell.swift index 82f3a8cd..28e1225c 100644 --- a/YELLO-iOS/YELLO-iOS/Presentation/Around/Cell/AroundTableViewCell.swift +++ b/YELLO-iOS/YELLO-iOS/Presentation/Around/Cell/AroundTableViewCell.swift @@ -43,7 +43,6 @@ final class AroundTableViewCell: UITableViewCell { override func layoutSubviews() { super.layoutSubviews() - contentView.frame = contentView.frame.inset(by: UIEdgeInsets(top: 0, left: 0, bottom: 8.adjustedHeight, right: 0)) } diff --git a/YELLO-iOS/YELLO-iOS/Presentation/Around/View/AroundView.swift b/YELLO-iOS/YELLO-iOS/Presentation/Around/View/AroundView.swift index cf848934..c7e02537 100644 --- a/YELLO-iOS/YELLO-iOS/Presentation/Around/View/AroundView.swift +++ b/YELLO-iOS/YELLO-iOS/Presentation/Around/View/AroundView.swift @@ -38,8 +38,8 @@ final class AroundView: BaseView { // MARK: Layout Helpers override func setUI() { - setStyle() - setLayout() + super.setUI() + setDelegate() updateView() } @@ -63,8 +63,6 @@ final class AroundView: BaseView { aroundTableView.do { $0.register(AroundTableViewCell.self, forCellReuseIdentifier: AroundTableViewCell.identifier) $0.register(AroundSkeletonTableViewCell.self, forCellReuseIdentifier: AroundSkeletonTableViewCell.identifier) - $0.dataSource = self - $0.delegate = self $0.separatorStyle = .none $0.showsVerticalScrollIndicator = false $0.showsHorizontalScrollIndicator = false @@ -120,6 +118,11 @@ final class AroundView: BaseView { } } + func setDelegate() { + aroundTableView.dataSource = self + aroundTableView.delegate = self + } + // MARK: Objc Function @objc func refreshTable(refresh: UIRefreshControl) { self.isRefreshing = true