From 55936089e11ab90f28f1df6cd05bec6ff7ced6d3 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Wed, 25 Jan 2017 15:25:22 +0300 Subject: [PATCH] [cleanup] [ios] Place page code cleanup. --- iphone/Maps/Maps.xcodeproj/project.pbxproj | 58 ++++++----- .../MWMOpeningHoursLayoutHelper.mm | 96 ++++++++++--------- .../RegularCell/MWMPlacePageInfoCell.h | 13 --- ...eInfoCell.xib => MWMPlacePageInfoCell.xib} | 31 +++--- ...eLinkCell.xib => MWMPlacePageLinkCell.xib} | 13 ++- .../RegularCell/MWMPlacePageRegularCell.h | 18 ++++ ...InfoCell.mm => MWMPlacePageRegularCell.mm} | 12 ++- .../PlacePageLayout/MWMPlacePageLayout.mm | 55 +++++------ .../Preview/MWMPPPreviewLayoutHelper.mm | 25 ++--- 9 files changed, 175 insertions(+), 146 deletions(-) delete mode 100644 iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.h rename iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/{PlacePageInfoCell.xib => MWMPlacePageInfoCell.xib} (83%) rename iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/{PlacePageLinkCell.xib => MWMPlacePageLinkCell.xib} (88%) create mode 100644 iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageRegularCell.h rename iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/{MWMPlacePageInfoCell.mm => MWMPlacePageRegularCell.mm} (96%) diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 393cca9edc..69be704b3a 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -1107,15 +1107,15 @@ F6E2FE841E097BA00083EBEC /* MWMPlacePageOpeningHoursWeekDayView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC01E097B9F0083EBEC /* MWMPlacePageOpeningHoursWeekDayView.xib */; }; F6E2FE851E097BA00083EBEC /* MWMPlacePageOpeningHoursWeekDayView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC01E097B9F0083EBEC /* MWMPlacePageOpeningHoursWeekDayView.xib */; }; F6E2FE861E097BA00083EBEC /* MWMPlacePageOpeningHoursWeekDayView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC01E097B9F0083EBEC /* MWMPlacePageOpeningHoursWeekDayView.xib */; }; - F6E2FE871E097BA00083EBEC /* MWMPlacePageInfoCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCC31E097B9F0083EBEC /* MWMPlacePageInfoCell.mm */; }; - F6E2FE881E097BA00083EBEC /* MWMPlacePageInfoCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCC31E097B9F0083EBEC /* MWMPlacePageInfoCell.mm */; }; - F6E2FE891E097BA00083EBEC /* MWMPlacePageInfoCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCC31E097B9F0083EBEC /* MWMPlacePageInfoCell.mm */; }; - F6E2FE8A1E097BA00083EBEC /* PlacePageInfoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC41E097B9F0083EBEC /* PlacePageInfoCell.xib */; }; - F6E2FE8B1E097BA00083EBEC /* PlacePageInfoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC41E097B9F0083EBEC /* PlacePageInfoCell.xib */; }; - F6E2FE8C1E097BA00083EBEC /* PlacePageInfoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC41E097B9F0083EBEC /* PlacePageInfoCell.xib */; }; - F6E2FE8D1E097BA00083EBEC /* PlacePageLinkCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC51E097B9F0083EBEC /* PlacePageLinkCell.xib */; }; - F6E2FE8E1E097BA00083EBEC /* PlacePageLinkCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC51E097B9F0083EBEC /* PlacePageLinkCell.xib */; }; - F6E2FE8F1E097BA00083EBEC /* PlacePageLinkCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC51E097B9F0083EBEC /* PlacePageLinkCell.xib */; }; + F6E2FE871E097BA00083EBEC /* MWMPlacePageRegularCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCC31E097B9F0083EBEC /* MWMPlacePageRegularCell.mm */; }; + F6E2FE881E097BA00083EBEC /* MWMPlacePageRegularCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCC31E097B9F0083EBEC /* MWMPlacePageRegularCell.mm */; }; + F6E2FE891E097BA00083EBEC /* MWMPlacePageRegularCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCC31E097B9F0083EBEC /* MWMPlacePageRegularCell.mm */; }; + F6E2FE8A1E097BA00083EBEC /* MWMPlacePageInfoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC41E097B9F0083EBEC /* MWMPlacePageInfoCell.xib */; }; + F6E2FE8B1E097BA00083EBEC /* MWMPlacePageInfoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC41E097B9F0083EBEC /* MWMPlacePageInfoCell.xib */; }; + F6E2FE8C1E097BA00083EBEC /* MWMPlacePageInfoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC41E097B9F0083EBEC /* MWMPlacePageInfoCell.xib */; }; + F6E2FE8D1E097BA00083EBEC /* MWMPlacePageLinkCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC51E097B9F0083EBEC /* MWMPlacePageLinkCell.xib */; }; + F6E2FE8E1E097BA00083EBEC /* MWMPlacePageLinkCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC51E097B9F0083EBEC /* MWMPlacePageLinkCell.xib */; }; + F6E2FE8F1E097BA00083EBEC /* MWMPlacePageLinkCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC51E097B9F0083EBEC /* MWMPlacePageLinkCell.xib */; }; F6E2FE901E097BA00083EBEC /* MWMPlacePageTaxiCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCC81E097B9F0083EBEC /* MWMPlacePageTaxiCell.mm */; }; F6E2FE911E097BA00083EBEC /* MWMPlacePageTaxiCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCC81E097B9F0083EBEC /* MWMPlacePageTaxiCell.mm */; }; F6E2FE921E097BA00083EBEC /* MWMPlacePageTaxiCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCC81E097B9F0083EBEC /* MWMPlacePageTaxiCell.mm */; }; @@ -2018,17 +2018,17 @@ F6E2FCB71E097B9F0083EBEC /* MWMOpeningHours.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMOpeningHours.mm; sourceTree = ""; }; F6E2FCB81E097B9F0083EBEC /* MWMOpeningHoursCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMOpeningHoursCell.xib; sourceTree = ""; }; F6E2FCB91E097B9F0083EBEC /* MWMOpeningHoursLayoutHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMOpeningHoursLayoutHelper.h; sourceTree = ""; }; - F6E2FCBA1E097B9F0083EBEC /* MWMOpeningHoursLayoutHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMOpeningHoursLayoutHelper.mm; sourceTree = ""; }; + F6E2FCBA1E097B9F0083EBEC /* MWMOpeningHoursLayoutHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMOpeningHoursLayoutHelper.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; F6E2FCBB1E097B9F0083EBEC /* MWMPlacePageOpeningHoursCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMPlacePageOpeningHoursCell.h; sourceTree = ""; }; F6E2FCBC1E097B9F0083EBEC /* MWMPlacePageOpeningHoursCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMPlacePageOpeningHoursCell.mm; sourceTree = ""; }; F6E2FCBD1E097B9F0083EBEC /* MWMPlacePageOpeningHoursCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMPlacePageOpeningHoursCell.xib; sourceTree = ""; }; F6E2FCBE1E097B9F0083EBEC /* MWMPlacePageOpeningHoursDayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMPlacePageOpeningHoursDayView.h; sourceTree = ""; }; F6E2FCBF1E097B9F0083EBEC /* MWMPlacePageOpeningHoursDayView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMPlacePageOpeningHoursDayView.mm; sourceTree = ""; }; F6E2FCC01E097B9F0083EBEC /* MWMPlacePageOpeningHoursWeekDayView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMPlacePageOpeningHoursWeekDayView.xib; sourceTree = ""; }; - F6E2FCC21E097B9F0083EBEC /* MWMPlacePageInfoCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMPlacePageInfoCell.h; sourceTree = ""; }; - F6E2FCC31E097B9F0083EBEC /* MWMPlacePageInfoCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMPlacePageInfoCell.mm; sourceTree = ""; }; - F6E2FCC41E097B9F0083EBEC /* PlacePageInfoCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PlacePageInfoCell.xib; sourceTree = ""; }; - F6E2FCC51E097B9F0083EBEC /* PlacePageLinkCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PlacePageLinkCell.xib; sourceTree = ""; }; + F6E2FCC21E097B9F0083EBEC /* MWMPlacePageRegularCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMPlacePageRegularCell.h; sourceTree = ""; }; + F6E2FCC31E097B9F0083EBEC /* MWMPlacePageRegularCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMPlacePageRegularCell.mm; sourceTree = ""; }; + F6E2FCC41E097B9F0083EBEC /* MWMPlacePageInfoCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMPlacePageInfoCell.xib; sourceTree = ""; }; + F6E2FCC51E097B9F0083EBEC /* MWMPlacePageLinkCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMPlacePageLinkCell.xib; sourceTree = ""; }; F6E2FCC71E097B9F0083EBEC /* MWMPlacePageTaxiCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMPlacePageTaxiCell.h; sourceTree = ""; }; F6E2FCC81E097B9F0083EBEC /* MWMPlacePageTaxiCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMPlacePageTaxiCell.mm; sourceTree = ""; }; F6E2FCC91E097B9F0083EBEC /* MWMPlacePageTaxiCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMPlacePageTaxiCell.xib; sourceTree = ""; }; @@ -2052,7 +2052,7 @@ F6E2FCDD1E097B9F0083EBEC /* _MWMPPPSubtitle.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = _MWMPPPSubtitle.xib; sourceTree = ""; }; F6E2FCDE1E097B9F0083EBEC /* _MWMPPPTitle.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = _MWMPPPTitle.xib; sourceTree = ""; }; F6E2FCDF1E097B9F0083EBEC /* MWMPPPreviewLayoutHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMPPPreviewLayoutHelper.h; sourceTree = ""; }; - F6E2FCE01E097B9F0083EBEC /* MWMPPPreviewLayoutHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMPPPreviewLayoutHelper.mm; sourceTree = ""; }; + F6E2FCE01E097B9F0083EBEC /* MWMPPPreviewLayoutHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMPPPreviewLayoutHelper.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; F6E2FCE31E097B9F0083EBEC /* MWMConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMConsole.h; sourceTree = ""; }; F6E2FCE41E097B9F0083EBEC /* MWMConsole.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMConsole.mm; sourceTree = ""; }; F6E2FCE61E097B9F0083EBEC /* MWMSearchFilterPresentationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchFilterPresentationController.h; sourceTree = ""; }; @@ -3622,10 +3622,10 @@ F6E2FCC11E097B9F0083EBEC /* RegularCell */ = { isa = PBXGroup; children = ( - F6E2FCC21E097B9F0083EBEC /* MWMPlacePageInfoCell.h */, - F6E2FCC31E097B9F0083EBEC /* MWMPlacePageInfoCell.mm */, - F6E2FCC41E097B9F0083EBEC /* PlacePageInfoCell.xib */, - F6E2FCC51E097B9F0083EBEC /* PlacePageLinkCell.xib */, + F6E2FCC21E097B9F0083EBEC /* MWMPlacePageRegularCell.h */, + F6E2FCC31E097B9F0083EBEC /* MWMPlacePageRegularCell.mm */, + F6E2FCC41E097B9F0083EBEC /* MWMPlacePageInfoCell.xib */, + F6E2FCC51E097B9F0083EBEC /* MWMPlacePageLinkCell.xib */, ); path = RegularCell; sourceTree = ""; @@ -4104,7 +4104,7 @@ EE583CBB12F773F00042CBE3 /* unicode_blocks.txt in Resources */, F6E2FDDC1E097BA00083EBEC /* MWMEditorTextTableViewCell.xib in Resources */, 340E1EF41E2F614400CE49BF /* SearchFilters.storyboard in Resources */, - F6E2FE8A1E097BA00083EBEC /* PlacePageInfoCell.xib in Resources */, + F6E2FE8A1E097BA00083EBEC /* MWMPlacePageInfoCell.xib in Resources */, EEFE7C1412F8C9E1006AF8C3 /* fonts_blacklist.txt in Resources */, F68FCB8C1DA7BD20007CC7D7 /* MWMTaxiPreviewCell.xib in Resources */, F6E2FD581E097BA00083EBEC /* MWMMapDownloaderButtonTableViewCell.xib in Resources */, @@ -4168,8 +4168,7 @@ F6E2FE6F1E097BA00083EBEC /* _MWMOHSubCell.xib in Resources */, F6172FA51BBD5A3E0081D325 /* MWMiPadRoutePreview.xib in Resources */, 97A5967F19B9CD47007A963F /* copyright.html in Resources */, - F6E2FDAF1E097BA00083EBEC /* MWMEditorAddAdditionalNameTableViewCell.xib in Resources */, - F6E2FE8D1E097BA00083EBEC /* PlacePageLinkCell.xib in Resources */, + F6E2FE8D1E097BA00083EBEC /* MWMPlacePageLinkCell.xib in Resources */, F6E2FD671E097BA00083EBEC /* MWMMapDownloaderPlaceTableViewCell.xib in Resources */, 671182E31C7F0DD400CB8177 /* WorldCoasts_obsolete.mwm in Resources */, 3463BA681DE81DB90082417F /* MWMTrafficButtonViewController.xib in Resources */, @@ -4314,7 +4313,7 @@ 6741A95C1BF340DE002C974C /* categories.txt in Resources */, 6741A95D1BF340DE002C974C /* types.txt in Resources */, F6E2FF1B1E097BA00083EBEC /* MWMSearchTabbedCollectionViewCell.xib in Resources */, - F6E2FE8E1E097BA00083EBEC /* PlacePageLinkCell.xib in Resources */, + F6E2FE8E1E097BA00083EBEC /* MWMPlacePageLinkCell.xib in Resources */, F6E2FDFB1E097BA00083EBEC /* MWMOpeningHoursAllDayTableViewCell.xib in Resources */, 6741A9601BF340DE002C974C /* MWMRoutingDisclaimerAlert.xib in Resources */, F6E2FE761E097BA00083EBEC /* MWMOpeningHoursCell.xib in Resources */, @@ -4379,8 +4378,7 @@ F6E2FD591E097BA00083EBEC /* MWMMapDownloaderButtonTableViewCell.xib in Resources */, F6E2FE521E097BA00083EBEC /* MWMActionBarButton.xib in Resources */, 349D1AE11E2E325C004A2006 /* MWMBottomMenuViewController.xib in Resources */, - F6E2FDD11E097BA00083EBEC /* MWMEditorSelectTableViewCell.xib in Resources */, - F6E2FE8B1E097BA00083EBEC /* PlacePageInfoCell.xib in Resources */, + F6E2FE8B1E097BA00083EBEC /* MWMPlacePageInfoCell.xib in Resources */, F6E2FD741E097BA00083EBEC /* MWMMapDownloaderTableViewCell.xib in Resources */, F64D9CA31C899C760063FA30 /* MWMEditorViralAlert.xib in Resources */, F6E2FEA91E097BA00083EBEC /* _MWMPPPAddress.xib in Resources */, @@ -4437,7 +4435,7 @@ 849CF5FE1DE842290024A8A5 /* MWMDefaultAlert.xib in Resources */, 849CF5FF1DE842290024A8A5 /* fonts_whitelist.txt in Resources */, F6E2FDF61E097BA00083EBEC /* MWMOpeningHoursAddScheduleTableViewCell.xib in Resources */, - F6E2FE8C1E097BA00083EBEC /* PlacePageInfoCell.xib in Resources */, + F6E2FE8C1E097BA00083EBEC /* MWMPlacePageInfoCell.xib in Resources */, 849CF6011DE842290024A8A5 /* MWMDownloaderDialogHeader.xib in Resources */, F6E2FF431E097BA00083EBEC /* MWMSearchTableViewController.xib in Resources */, 849CF6021DE842290024A8A5 /* World.mwm in Resources */, @@ -4506,7 +4504,7 @@ 849CF6471DE842290024A8A5 /* MWMSideButtonsView.xib in Resources */, 849CF64A1DE842290024A8A5 /* editor.config in Resources */, F6E2FEBC1E097BA00083EBEC /* _MWMPPPTitle.xib in Resources */, - F6E2FE8F1E097BA00083EBEC /* PlacePageLinkCell.xib in Resources */, + F6E2FE8F1E097BA00083EBEC /* MWMPlacePageLinkCell.xib in Resources */, 34F73FA41E08300E00AC1FD6 /* Images.xcassets in Resources */, 849CF64C1DE842290024A8A5 /* synonyms.txt in Resources */, F6E2FF071E097BA00083EBEC /* MWMSearchHistoryClearCell.xib in Resources */, @@ -4758,7 +4756,7 @@ F6FEA82D1C58E89B007223CC /* MWMButton.mm in Sources */, F6E2FE3C1E097BA00083EBEC /* MWMMigrationViewController.mm in Sources */, F6E2FD4F1E097BA00083EBEC /* MWMMapDownloaderAdsTableViewCell.mm in Sources */, - F6E2FE871E097BA00083EBEC /* MWMPlacePageInfoCell.mm in Sources */, + F6E2FE871E097BA00083EBEC /* MWMPlacePageRegularCell.mm in Sources */, 34D3AFE91E378AF1004100F9 /* UINib+Init.swift in Sources */, F6E2FD7F1E097BA00083EBEC /* MWMMapDownloaderExtendedDataSourceWithAds.mm in Sources */, F6BD33871B62412E00F2CE18 /* MWMNavigationDashboardEntity.mm in Sources */, @@ -5012,7 +5010,7 @@ 340475591E081A4600C92850 /* WebViewController.mm in Sources */, F6E2FE3D1E097BA00083EBEC /* MWMMigrationViewController.mm in Sources */, F6E2FD501E097BA00083EBEC /* MWMMapDownloaderAdsTableViewCell.mm in Sources */, - F6E2FE881E097BA00083EBEC /* MWMPlacePageInfoCell.mm in Sources */, + F6E2FE881E097BA00083EBEC /* MWMPlacePageRegularCell.mm in Sources */, F6E2FD801E097BA00083EBEC /* MWMMapDownloaderExtendedDataSourceWithAds.mm in Sources */, 34D3AFEA1E378AF1004100F9 /* UINib+Init.swift in Sources */, 6741A9F11BF340DE002C974C /* MWMNavigationDashboardEntity.mm in Sources */, @@ -5268,7 +5266,7 @@ 849CF6E91DE842290024A8A5 /* MWMCircularProgressView.mm in Sources */, F6E2FE3E1E097BA00083EBEC /* MWMMigrationViewController.mm in Sources */, F6E2FD511E097BA00083EBEC /* MWMMapDownloaderAdsTableViewCell.mm in Sources */, - F6E2FE891E097BA00083EBEC /* MWMPlacePageInfoCell.mm in Sources */, + F6E2FE891E097BA00083EBEC /* MWMPlacePageRegularCell.mm in Sources */, 34D3AFEB1E378AF1004100F9 /* UINib+Init.swift in Sources */, F6E2FD811E097BA00083EBEC /* MWMMapDownloaderExtendedDataSourceWithAds.mm in Sources */, 849CF6EB1DE842290024A8A5 /* MWMAPIBar.mm in Sources */, diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/OpeningHoursCell/MWMOpeningHoursLayoutHelper.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/OpeningHoursCell/MWMOpeningHoursLayoutHelper.mm index e797b2325b..a60a0feb19 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/OpeningHoursCell/MWMOpeningHoursLayoutHelper.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/OpeningHoursCell/MWMOpeningHoursLayoutHelper.mm @@ -3,50 +3,10 @@ #import "MWMOpeningHours.h" #import "MWMPlacePageData.h" #import "MWMTableViewCell.h" +#import "SwiftBridge.h" #include "std/array.hpp" -namespace -{ -array const kCells = {{@"_MWMOHHeaderCell", @"_MWMOHSubCell"}}; - -NSAttributedString * richStringFromDay(osmoh::Day const & day, BOOL isClosedNow) -{ - auto const richString = ^NSMutableAttributedString * (NSString * str, UIFont * font, UIColor * color) - { - return [[NSMutableAttributedString alloc] initWithString:str - attributes:@{NSFontAttributeName : font, - NSForegroundColorAttributeName : color}]; - }; - - auto str = richString(day.TodayTime(), [UIFont regular17], day.m_isOpen ? [UIColor blackPrimaryText] : - [UIColor red]); - if (day.m_isOpen) - { - auto lineBreak = [[NSAttributedString alloc] initWithString:@"\n"]; - - if (day.m_breaks.length) - { - [str appendAttributedString:lineBreak]; - [str appendAttributedString:richString(day.m_breaks, [UIFont regular13], [UIColor blackSecondaryText])]; - } - - if (isClosedNow) - { - [str appendAttributedString:lineBreak]; - [str appendAttributedString:richString(L(@"closed_now"), [UIFont regular13], [UIColor red])]; - } - - auto paragraphStyle = [[NSMutableParagraphStyle alloc] init]; - paragraphStyle.lineSpacing = 4; - - [str addAttributes:@{NSParagraphStyleAttributeName : paragraphStyle} range:{0, str.length}]; - } - return str; -} - -} // namespace - @interface MWMPlacePageData() - (vector &)mutableMetainfoRows; @@ -97,6 +57,48 @@ NSAttributedString * richStringFromDay(osmoh::Day const & day, BOOL isClosedNow) @end +namespace +{ +array const kCells = {{[_MWMOHHeaderCell class], [_MWMOHSubCell class]}}; + +NSAttributedString * richStringFromDay(osmoh::Day const & day, BOOL isClosedNow) +{ + auto const richString = + ^NSMutableAttributedString *(NSString * str, UIFont * font, UIColor * color) + { + return [[NSMutableAttributedString alloc] + initWithString:str + attributes:@{NSFontAttributeName : font, NSForegroundColorAttributeName : color}]; + }; + + auto str = richString(day.TodayTime(), [UIFont regular17], + day.m_isOpen ? [UIColor blackPrimaryText] : [UIColor red]); + if (day.m_isOpen) + { + auto lineBreak = [[NSAttributedString alloc] initWithString:@"\n"]; + + if (day.m_breaks.length) + { + [str appendAttributedString:lineBreak]; + [str appendAttributedString:richString(day.m_breaks, [UIFont regular13], + [UIColor blackSecondaryText])]; + } + + if (isClosedNow) + { + [str appendAttributedString:lineBreak]; + [str appendAttributedString:richString(L(@"closed_now"), [UIFont regular13], [UIColor red])]; + } + + auto paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + paragraphStyle.lineSpacing = 4; + + [str addAttributes:@{ NSParagraphStyleAttributeName : paragraphStyle } range:{0, str.length}]; + } + return str; +} + +} // namespace @interface MWMOpeningHoursLayoutHelper() { @@ -127,8 +129,8 @@ NSAttributedString * richStringFromDay(osmoh::Day const & day, BOOL isClosedNow) - (void)registerCells { - for (auto name : kCells) - [self.tableView registerNib:[UINib nibWithNibName:name bundle:nil] forCellReuseIdentifier:name]; + for (Class cls : kCells) + [self.tableView registerWithCellClass:cls]; } - (void)configWithData:(MWMPlacePageData *)data @@ -146,7 +148,9 @@ NSAttributedString * richStringFromDay(osmoh::Day const & day, BOOL isClosedNow) if (self.data.metainfoRows[indexPath.row] == place_page::MetainfoRows::OpeningHours) { - _MWMOHHeaderCell * cell = [tableView dequeueReusableCellWithIdentifier:[_MWMOHHeaderCell className]]; + Class cls = [_MWMOHHeaderCell class]; + auto cell = static_cast<_MWMOHHeaderCell *>( + [tableView dequeueReusableCellWithCellClass:cls indexPath:indexPath]); if (m_days.size() > 1) { @@ -189,7 +193,9 @@ NSAttributedString * richStringFromDay(osmoh::Day const & day, BOOL isClosedNow) } else { - _MWMOHSubCell * cell = [tableView dequeueReusableCellWithIdentifier:[_MWMOHSubCell className]]; + Class cls = [_MWMOHSubCell class]; + auto cell = static_cast<_MWMOHSubCell *>( + [tableView dequeueReusableCellWithCellClass:cls indexPath:indexPath]); cell.days.text = day.m_workingDays; cell.schedule.text = day.m_workingTimes ?: L(@"closed"); cell.breaks.text = day.m_breaks; diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.h b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.h deleted file mode 100644 index 576b5e1b17..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.h +++ /dev/null @@ -1,13 +0,0 @@ -#import "MWMTableViewCell.h" - -#import "MWMPlacePageData.h" - -@interface MWMPlacePageInfoCell : MWMTableViewCell - -- (void)configWithRow:(place_page::MetainfoRows)row - data:(MWMPlacePageData *)data; - -@property(weak, nonatomic, readonly) IBOutlet UIImageView * icon; -@property(weak, nonatomic, readonly) IBOutlet id textContainer; - -@end diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/PlacePageInfoCell.xib b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.xib similarity index 83% rename from iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/PlacePageInfoCell.xib rename to iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.xib index 55322599ac..6320acce64 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/PlacePageInfoCell.xib +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.xib @@ -1,13 +1,17 @@ - - + + + + + - + + - + @@ -25,14 +29,14 @@ - + @@ -95,4 +99,9 @@ + + + + + diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/PlacePageLinkCell.xib b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageLinkCell.xib similarity index 88% rename from iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/PlacePageLinkCell.xib rename to iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageLinkCell.xib index 7f38c6bcef..183eab2414 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/PlacePageLinkCell.xib +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageLinkCell.xib @@ -1,21 +1,25 @@ - + + + + - + - + - + + @@ -25,6 +29,7 @@ + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageRegularCell.h b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageRegularCell.h new file mode 100644 index 0000000000..68473e7c12 --- /dev/null +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageRegularCell.h @@ -0,0 +1,18 @@ +#import "MWMTableViewCell.h" + +#import "MWMPlacePageData.h" + +@interface MWMPlacePageRegularCell : MWMTableViewCell + +- (void)configWithRow:(place_page::MetainfoRows)row data:(MWMPlacePageData *)data; + +@property(weak, nonatomic, readonly) IBOutlet UIImageView * icon; +@property(weak, nonatomic, readonly) IBOutlet id textContainer; + +@end + +@interface MWMPlacePageInfoCell : MWMPlacePageRegularCell +@end + +@interface MWMPlacePageLinkCell : MWMPlacePageRegularCell +@end diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageRegularCell.mm similarity index 96% rename from iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.mm rename to iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageRegularCell.mm index eae985b86a..6397da5b26 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageInfoCell.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/RegularCell/MWMPlacePageRegularCell.mm @@ -1,4 +1,4 @@ -#import "MWMPlacePageInfoCell.h" +#import "MWMPlacePageRegularCell.h" #import "MWMCommon.h" #import "MapViewController.h" #import "MapsAppDelegate.h" @@ -8,7 +8,7 @@ #include "platform/measurement_utils.hpp" #include "platform/settings.hpp" -@interface MWMPlacePageInfoCell () +@interface MWMPlacePageRegularCell () @property(weak, nonatomic, readwrite) IBOutlet UIImageView * icon; @property(weak, nonatomic, readwrite) IBOutlet id textContainer; @@ -21,7 +21,7 @@ @end -@implementation MWMPlacePageInfoCell +@implementation MWMPlacePageRegularCell - (void)awakeFromNib { @@ -172,3 +172,9 @@ } @end + +@implementation MWMPlacePageInfoCell +@end + +@implementation MWMPlacePageLinkCell +@end diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm index 42e6a2fb17..d756359c77 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm @@ -6,8 +6,8 @@ #import "MWMPlacePageButtonCell.h" #import "MWMPlacePageCellUpdateProtocol.h" #import "MWMPlacePageData.h" -#import "MWMPlacePageInfoCell.h" #import "MWMPlacePageLayoutImpl.h" +#import "MWMPlacePageRegularCell.h" #import "MWMPlacePageTaxiCell.h" #import "MWMiPadPlacePageLayoutImpl.h" #import "MWMiPhonePlacePageLayoutImpl.h" @@ -20,23 +20,18 @@ namespace { -array const kBookmarkCells = {{@"MWMBookmarkCell"}}; - using place_page::MetainfoRows; -map const kMetaInfoCells = { - {MetainfoRows::Website, @"PlacePageLinkCell"}, - {MetainfoRows::Address, @"PlacePageInfoCell"}, - {MetainfoRows::Email, @"PlacePageLinkCell"}, - {MetainfoRows::Phone, @"PlacePageLinkCell"}, - {MetainfoRows::Cuisine, @"PlacePageInfoCell"}, - {MetainfoRows::Operator, @"PlacePageInfoCell"}, - {MetainfoRows::Coordinate, @"PlacePageInfoCell"}, - {MetainfoRows::Internet, @"PlacePageInfoCell"}, - {MetainfoRows::Taxi, @"MWMPlacePageTaxiCell"}}; - -array const kButtonsCells = {{@"MWMPlacePageButtonCell"}}; - +map const kMetaInfoCells = { + {MetainfoRows::Website, [MWMPlacePageLinkCell class]}, + {MetainfoRows::Address, [MWMPlacePageInfoCell class]}, + {MetainfoRows::Email, [MWMPlacePageLinkCell class]}, + {MetainfoRows::Phone, [MWMPlacePageLinkCell class]}, + {MetainfoRows::Cuisine, [MWMPlacePageInfoCell class]}, + {MetainfoRows::Operator, [MWMPlacePageInfoCell class]}, + {MetainfoRows::Coordinate, [MWMPlacePageInfoCell class]}, + {MetainfoRows::Internet, [MWMPlacePageInfoCell class]}, + {MetainfoRows::Taxi, [MWMPlacePageTaxiCell class]}}; } // namespace @interface MWMPlacePageLayout () const kButtonsCells = {{@"MWMPlacePageButtonCell"}}; - (void)registerCells { auto tv = self.placePageView.tableView; - - [tv registerNib:[UINib nibWithNibName:kButtonsCells[0] bundle:nil] - forCellReuseIdentifier:kButtonsCells[0]]; - [tv registerNib:[UINib nibWithNibName:kBookmarkCells[0] bundle:nil] - forCellReuseIdentifier:kBookmarkCells[0]]; + [tv registerWithCellClass:[MWMPlacePageButtonCell class]]; + [tv registerWithCellClass:[MWMBookmarkCell class]]; // Register all meta info cells. for (auto const & pair : kMetaInfoCells) - { - NSString * name = pair.second; - [tv registerNib:[UINib nibWithNibName:name bundle:nil] forCellReuseIdentifier:name]; - } + [tv registerWithCellClass:pair.second]; } - (void)layoutWithSize:(CGSize const &)size @@ -314,7 +303,9 @@ array const kButtonsCells = {{@"MWMPlacePageButtonCell"}}; } case Sections::Bookmark: { - MWMBookmarkCell * c = [tableView dequeueReusableCellWithIdentifier:kBookmarkCells[0]]; + Class cls = [MWMBookmarkCell class]; + auto c = static_cast( + [tableView dequeueReusableCellWithCellClass:cls indexPath:indexPath]); [c configureWithText:data.bookmarkDescription updateCellDelegate:self editBookmarkDelegate:delegate @@ -338,13 +329,17 @@ array const kButtonsCells = {{@"MWMPlacePageButtonCell"}}; case MetainfoRows::Internet: case MetainfoRows::Coordinate: { - MWMPlacePageInfoCell * c = [tableView dequeueReusableCellWithIdentifier:kMetaInfoCells.at(row)]; + Class cls = kMetaInfoCells.at(row); + auto c = static_cast( + [tableView dequeueReusableCellWithCellClass:cls indexPath:indexPath]); [c configWithRow:row data:data]; return c; } case MetainfoRows::Taxi: { - MWMPlacePageTaxiCell * c = [tableView dequeueReusableCellWithIdentifier:kMetaInfoCells.at(row)]; + Class cls = kMetaInfoCells.at(row); + auto c = static_cast( + [tableView dequeueReusableCellWithCellClass:cls indexPath:indexPath]); c.delegate = delegate; return c; } @@ -352,7 +347,9 @@ array const kButtonsCells = {{@"MWMPlacePageButtonCell"}}; } case Sections::Buttons: { - MWMPlacePageButtonCell * c = [tableView dequeueReusableCellWithIdentifier:kButtonsCells[0]]; + Class cls = [MWMPlacePageButtonCell class]; + auto c = static_cast( + [tableView dequeueReusableCellWithCellClass:cls indexPath:indexPath]); auto const row = data.buttonsRows[indexPath.row]; [c configForRow:row withDelegate:delegate]; diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm index 0496a6f3e1..43959a7f64 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm @@ -1,19 +1,14 @@ #import "MWMPPPreviewLayoutHelper.h" #import "MWMCommon.h" #import "MWMDirectionView.h" -#import "MWMPlacePageData.h" #import "MWMPPPreviewBannerCell.h" +#import "MWMPlacePageData.h" #import "MWMTableViewCell.h" #import "Statistics.h" +#import "SwiftBridge.h" #include "std/array.hpp" -namespace -{ -array const kPreviewCells = {{@"_MWMPPPTitle", @"_MWMPPPExternalTitle", @"_MWMPPPSubtitle", - @"_MWMPPPSchedule", @"_MWMPPPBooking", @"_MWMPPPAddress", @"_MWMPPPSpace", @"MWMPPPreviewBannerCell"}}; -} // namespace - #pragma mark - Base // Base class for avoiding copy-paste in inheriting cells. @interface _MWMPPPCellBase : MWMTableViewCell @@ -125,6 +120,14 @@ array const kPreviewCells = {{@"_MWMPPPTitle", @"_MWMPPPExternalT @implementation _MWMPPPSpace @end +namespace +{ +array const kPreviewCells = {{[_MWMPPPTitle class], [_MWMPPPExternalTitle class], + [_MWMPPPSubtitle class], [_MWMPPPSchedule class], + [_MWMPPPBooking class], [_MWMPPPAddress class], + [_MWMPPPSpace class], [MWMPPPreviewBannerCell class]}}; +} // namespace + @interface MWMPPPreviewLayoutHelper () @property(weak, nonatomic) UITableView * tableView; @@ -160,8 +163,8 @@ array const kPreviewCells = {{@"_MWMPPPTitle", @"_MWMPPPExternalT - (void)registerCells { - for (auto name : kPreviewCells) - [self.tableView registerNib:[UINib nibWithNibName:name bundle:nil] forCellReuseIdentifier:name]; + for (Class cls : kPreviewCells) + [self.tableView registerWithCellClass:cls]; } - (void)configWithData:(MWMPlacePageData *)data @@ -180,9 +183,9 @@ array const kPreviewCells = {{@"_MWMPPPTitle", @"_MWMPPPExternalT using namespace place_page; auto tableView = self.tableView; auto const row = data.previewRows[indexPath.row]; - auto cellName = kPreviewCells[static_cast(row)]; + Class cls = kPreviewCells[static_cast(row)]; - auto * c = [tableView dequeueReusableCellWithIdentifier:cellName]; + auto * c = [tableView dequeueReusableCellWithCellClass:cls indexPath:indexPath]; switch(row) { case PreviewRows::Title: