From 2702cc471c7a1b63d94b6e598f6416d65fe6e22f Mon Sep 17 00:00:00 2001 From: Kevin Li Date: Tue, 14 Jul 2020 22:48:47 -0700 Subject: [PATCH] fixed reloading pages --- .../ElegantPages/Lists/Internal/ElegantListController.swift | 4 ---- Sources/ElegantPages/Models/Internal/PageState.swift | 1 - Sources/ElegantPages/Models/Public/ElegantListManager.swift | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Sources/ElegantPages/Lists/Internal/ElegantListController.swift b/Sources/ElegantPages/Lists/Internal/ElegantListController.swift index 75f3f60..b676b70 100644 --- a/Sources/ElegantPages/Lists/Internal/ElegantListController.swift +++ b/Sources/ElegantPages/Lists/Internal/ElegantListController.swift @@ -45,10 +45,6 @@ struct ElegantListController: UIViewControllerRepresentable, ElegantListManagerD self.setActiveIndex(1, animated: false, complete: true) } } - case .reloadAll: - controller.reset(manager: manager) { - self.setActiveIndex(self.manager.activeIndex, animated: false, complete: true) - } case .completed: () } diff --git a/Sources/ElegantPages/Models/Internal/PageState.swift b/Sources/ElegantPages/Models/Internal/PageState.swift index 6b8631f..8a352a3 100644 --- a/Sources/ElegantPages/Models/Internal/PageState.swift +++ b/Sources/ElegantPages/Models/Internal/PageState.swift @@ -6,7 +6,6 @@ enum PageState { case rearrange case scroll(animated: Bool) - case reloadAll case completed } diff --git a/Sources/ElegantPages/Models/Public/ElegantListManager.swift b/Sources/ElegantPages/Models/Public/ElegantListManager.swift index f92c04b..7e88473 100644 --- a/Sources/ElegantPages/Models/Public/ElegantListManager.swift +++ b/Sources/ElegantPages/Models/Public/ElegantListManager.swift @@ -41,7 +41,7 @@ public class ElegantListManager: ObservableObject { } public func reloadPages() { - currentPage = (currentPage.index, .reloadAll) + currentPage = (currentPage.index, .scroll(animated: false)) } // Only ever called for a page view with more than 3 pages