From bdb3fb0a212ea73c04493cddbcab46598326cf93 Mon Sep 17 00:00:00 2001 From: kpk0616 Date: Fri, 13 Jan 2023 18:34:02 +0900 Subject: [PATCH] =?UTF-8?q?[Syte]=20#46=20-=20HomeViewController=20?= =?UTF-8?q?=EC=A0=95=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controllers/HomeViewController.swift | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Keyneez/Keyneez/Tab/Home/Controllers/HomeViewController.swift b/Keyneez/Keyneez/Tab/Home/Controllers/HomeViewController.swift index 033ee93..9d6612e 100644 --- a/Keyneez/Keyneez/Tab/Home/Controllers/HomeViewController.swift +++ b/Keyneez/Keyneez/Tab/Home/Controllers/HomeViewController.swift @@ -50,24 +50,24 @@ final class HomeViewController: NiblessViewController, NavigationBarProtocol { } private var repository: ContentRepository = KeyneezContentRepository() - var datasources: [[HomeContentResponseDto]] = [] + var datasources: [[HomeContentResponseDto]] = [] let VCs: [HomeContentViewController] = [HomeContentViewController(), HomeContentViewController(), HomeContentViewController()] override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) + super.viewWillAppear(animated) guard let token = UserSession.shared.accessToken else { return } repository.getAllContents(token: token) { - [weak self] arr in - guard let self else {return} - self.datasources.append(arr) - DispatchQueue.main.async { - self.VCs.forEach { - $0.contentList = self.datasources[0] - $0.recommendContentCollectionView.reloadData() - } - } - } + [weak self] arr in + guard let self else {return} + self.datasources.append(arr) + DispatchQueue.main.async { + self.VCs.forEach { + $0.contentList = self.datasources[0] + $0.recommendContentCollectionView.reloadData() + } + } } + } } // MARK: - extra functions @@ -129,8 +129,8 @@ extension HomeViewController { viewController.didMove(toParent: self) } private func remove(asChildViewController viewController: UIViewController) { - viewController.willMove(toParent: nil) - viewController.view.removeFromSuperview() - viewController.removeFromParent() + viewController.willMove(toParent: nil) + viewController.view.removeFromSuperview() + viewController.removeFromParent() } }