From 4f6e7dc4a81fec568b062613a26f8700a74671f0 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 8 Jan 2020 18:07:58 -0700 Subject: [PATCH] Update refresh progress view so that it updates at a minimum of every 60 seconds. --- iOS/MasterFeed/RefreshProgressView.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/iOS/MasterFeed/RefreshProgressView.swift b/iOS/MasterFeed/RefreshProgressView.swift index b793d276d..9214d3b4c 100644 --- a/iOS/MasterFeed/RefreshProgressView.swift +++ b/iOS/MasterFeed/RefreshProgressView.swift @@ -23,6 +23,8 @@ class RefreshProgressView: UIView { } else { updateRefreshLabel() } + + scheduleUpdateRefreshLabel() } func updateRefreshLabel() { @@ -87,4 +89,12 @@ private extension RefreshProgressView { } } } + + func scheduleUpdateRefreshLabel() { + DispatchQueue.main.asyncAfter(deadline: .now() + 60) { [weak self] in + self?.updateRefreshLabel() + self?.scheduleUpdateRefreshLabel() + } + } + }