From 10527ccc8175975f89350da97f6406993758e43b Mon Sep 17 00:00:00 2001 From: Kirill Zhdanovich Date: Fri, 23 Aug 2013 12:44:20 +0300 Subject: [PATCH] [iOS] Scroll to top fix --- iOS/offlineguides/ArticleVC.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iOS/offlineguides/ArticleVC.mm b/iOS/offlineguides/ArticleVC.mm index 92a9ac2..bb07c14 100644 --- a/iOS/offlineguides/ArticleVC.mm +++ b/iOS/offlineguides/ArticleVC.mm @@ -179,9 +179,9 @@ m_storage.QueryArticleInfo([searchText UTF8String], self.locationManager.location.coordinate.latitude, self.locationManager.location.coordinate.longitude); else m_storage.QueryArticleInfo([searchText UTF8String]); - if ([searchText length]) - [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES]; [self.tableView reloadData]; + if (m_storage.GetResultsCount() && [self.tableView numberOfRowsInSection:0]) + [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES]; } #pragma mark - Utils methods