From 79824df7e3580501ff3bedeedddf93a29e91eab3 Mon Sep 17 00:00:00 2001 From: David Sinclair Date: Tue, 13 Nov 2018 14:56:44 -0800 Subject: [PATCH] iOS: #1139 (scroll to top) Better fix; just needed to add an extra layout before the animation. --- clients/ios/Classes/NBNotifier.m | 8 +------- clients/ios/Classes/NewsBlurViewController.m | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/clients/ios/Classes/NBNotifier.m b/clients/ios/Classes/NBNotifier.m index 706c8a980..df6138acd 100644 --- a/clients/ios/Classes/NBNotifier.m +++ b/clients/ios/Classes/NBNotifier.m @@ -219,10 +219,6 @@ } - (void)showIn:(float)time { - if (showing) { - return; - } - showing = YES; // CGRect frame = self.frame; // frame.size.width = self.view.frame.size.width; @@ -231,9 +227,7 @@ topOffsetConstraint.constant = -1 * NOTIFIER_HEIGHT; - if (time == 0) { - return; - } + [self.superview layoutIfNeeded]; [UIView animateWithDuration:time animations:^{ // CGRect move = self.frame; diff --git a/clients/ios/Classes/NewsBlurViewController.m b/clients/ios/Classes/NewsBlurViewController.m index d9da9e239..912b7ffb8 100644 --- a/clients/ios/Classes/NewsBlurViewController.m +++ b/clients/ios/Classes/NewsBlurViewController.m @@ -2277,7 +2277,7 @@ heightForHeaderInSection:(NSInteger)section { self.notifier.style = NBSyncingStyle; self.notifier.title = @"On its way..."; [self.notifier setProgress:0]; - [self.notifier showIn:self.inPullToRefresh_ ? 0.3f : 0.0f]; + [self.notifier show]; } - (void)showCountingNotifier {