From c8b0cb88eecfcc8e63ebce6afc435cfb8460abb1 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Tue, 15 Mar 2016 14:17:15 +0300 Subject: [PATCH] [ios] Added parent downloader controllers notification. --- .../MWMBaseMapDownloaderViewController.mm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/iphone/Maps/Classes/MapDownloader/MWMBaseMapDownloaderViewController.mm b/iphone/Maps/Classes/MapDownloader/MWMBaseMapDownloaderViewController.mm index 990c3fd3a5..d7c3dc08b5 100644 --- a/iphone/Maps/Classes/MapDownloader/MWMBaseMapDownloaderViewController.mm +++ b/iphone/Maps/Classes/MapDownloader/MWMBaseMapDownloaderViewController.mm @@ -106,6 +106,16 @@ using namespace storage; { if (self.skipCountryEventProcessing) return; + auto notifyParentController = ^ + { + NSArray * viewControllers = [self.navigationController viewControllers]; + NSInteger const selfIndex = [viewControllers indexOfObject:self]; + if (selfIndex < 1) + return; + MWMViewController * parentVC = viewControllers[selfIndex - 1]; + if ([parentVC isKindOfClass:[MWMBaseMapDownloaderViewController class]]) + [static_cast(parentVC) processCountryEvent:countryId]; + }; auto process = ^ { [self configAllMapsView]; @@ -128,6 +138,8 @@ using namespace storage; for (auto & section : sections) [indexSet addIndex:section]; [tv reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; + + notifyParentController(); }; if (countryId == self.parentCountryId)