From 075819afbad0be1716af0440e9d3fe5f0798dff5 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Tue, 12 Apr 2016 16:04:57 +0300 Subject: [PATCH] Review fixes. --- .../DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm index 8e487f164d..984bf643d4 100644 --- a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm @@ -93,10 +93,10 @@ CGFloat const kAnimationDuration = .05; + (instancetype)alertWithCountries:(storage::TCountriesVec const &)countries { - NSAssert(!countries.empty(), @"TCountriesVec can not be empty."); + NSAssert(!countries.empty(), @"countries can not be empty."); MWMDownloadTransitMapAlert * alert = [[[NSBundle mainBundle] loadNibNamed:kDownloadTransitMapAlertNibName owner:nil options:nil] firstObject]; - NSMutableArray * titles = [@[] mutableCopy]; + NSMutableArray * titles = [@[] mutableCopy]; storage::TMwmSize totalSize = 0; auto const & s = GetFramework().Storage(); for (auto const & countryId : countries) @@ -135,6 +135,7 @@ CGFloat const kAnimationDuration = .05; - (void)processCountryEvent:(TCountryId const &)countryId { auto const overallProgress = GetFramework().Storage().GetOverallProgress(m_countries); + // Test if downloading has finished by comparing downloaded and total sizes. if (overallProgress.first == overallProgress.second) { self.downloadCompleteBlock(); @@ -202,7 +203,7 @@ CGFloat const kAnimationDuration = .05; CGFloat const actualHeight = kCellHeight * m_countries.size() + kHeaderHeight; CGFloat const height = [self bounded:actualHeight withHeight:self.superview.height]; self.tableViewHeight.constant = height; - self.dialogsTableView.scrollEnabled = actualHeight > self.tableViewHeight.constant ? YES : NO; + self.dialogsTableView.scrollEnabled = actualHeight > self.tableViewHeight.constant; [UIView animateWithDuration:kAnimationDuration animations:^{ [self layoutSubviews]; } completion:^(BOOL finished) {