From f0173f149aa482d38d33bce186448013b77528b6 Mon Sep 17 00:00:00 2001 From: MaraMincho <103064352+MaraMincho@users.noreply.github.com> Date: Fri, 12 Jan 2024 10:58:44 +0900 Subject: [PATCH] =?UTF-8?q?style:=20=ED=94=BC=EB=93=9C=EB=B0=B1=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=20=EB=B0=8F=20=EC=93=B0=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EB=8A=94=20import=EB=AC=B8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Presntaion/HomeScene/VIew/FeedImageCell.swift | 2 -- .../HomeScene/VIew/FeedItemCollectionViewCell.swift | 1 - .../HomeScene/ViewController/HomeViewController.swift | 6 ++++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/iOS/Projects/Features/Home/Sources/Presntaion/HomeScene/VIew/FeedImageCell.swift b/iOS/Projects/Features/Home/Sources/Presntaion/HomeScene/VIew/FeedImageCell.swift index ed82e60f..275b40b5 100644 --- a/iOS/Projects/Features/Home/Sources/Presntaion/HomeScene/VIew/FeedImageCell.swift +++ b/iOS/Projects/Features/Home/Sources/Presntaion/HomeScene/VIew/FeedImageCell.swift @@ -7,7 +7,6 @@ // import Cacher -import ImageDownsampling import UIKit // MARK: - FeedImageCell @@ -56,7 +55,6 @@ final class FeedImageCell: UICollectionViewCell { guard let data = try? Data(contentsOf: imageURL) else { return } DispatchQueue.main.async { [weak self] in self?.feedImage.image = UIImage(data: data) - self?.layoutIfNeeded() } } return diff --git a/iOS/Projects/Features/Home/Sources/Presntaion/HomeScene/VIew/FeedItemCollectionViewCell.swift b/iOS/Projects/Features/Home/Sources/Presntaion/HomeScene/VIew/FeedItemCollectionViewCell.swift index 14bfc91c..a13df4b5 100644 --- a/iOS/Projects/Features/Home/Sources/Presntaion/HomeScene/VIew/FeedItemCollectionViewCell.swift +++ b/iOS/Projects/Features/Home/Sources/Presntaion/HomeScene/VIew/FeedItemCollectionViewCell.swift @@ -6,7 +6,6 @@ // Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. // -import Cacher import DesignSystem import UIKit diff --git a/iOS/Projects/Features/Home/Sources/Presntaion/HomeScene/ViewController/HomeViewController.swift b/iOS/Projects/Features/Home/Sources/Presntaion/HomeScene/ViewController/HomeViewController.swift index f4eb7c49..3a5f7f1a 100644 --- a/iOS/Projects/Features/Home/Sources/Presntaion/HomeScene/ViewController/HomeViewController.swift +++ b/iOS/Projects/Features/Home/Sources/Presntaion/HomeScene/ViewController/HomeViewController.swift @@ -194,8 +194,10 @@ private extension HomeViewController { extension HomeViewController: UICollectionViewDelegate { func collectionView(_: UICollectionView, willDisplay _: UICollectionViewCell, forItemAt indexPath: IndexPath) { - // 만약 셀이 모자르다면 요청을 보냄 - if (feedCount - 1) - indexPath.row < 3 { + + /// 사용자가 아직 보지 않은 셀의 갯수 + let toShowCellCount = (feedCount - 1) - indexPath.row + if toShowCellCount < 3 { fetchFeedPublisher.send() } }