From d0e9f80a4e38e602172b352289002dac71c9fb12 Mon Sep 17 00:00:00 2001 From: Aleksey Belouosv Date: Wed, 8 Jan 2020 11:31:36 +0300 Subject: [PATCH] [iOS] [refactoring] remove old files --- iphone/Maps/Bridging-Header.h | 1 - iphone/Maps/Maps.xcodeproj/project.pbxproj | 73 +-------- .../Maps/UI/PlacePage/MWMPlacePageManager.mm | 6 - .../Content/UGC/UGCRating.swift | 12 -- .../Content/UGC/UGCReview.swift | 14 -- .../Content/UGC/UGCReviewCell.swift | 26 --- .../Content/UGC/UGCReviewCell.xib | 100 ------------ .../Content/UGC/UGCSummaryRatingCell.swift | 54 ------- .../Content/UGC/UGCSummaryRatingCell.xib | 127 --------------- .../UGC/UGCSummaryRatingStarsCell.swift | 10 -- .../Content/UGC/UGCSummaryRatingStarsCell.xib | 43 ----- .../Content/UGC/UGCYourReview.swift | 12 -- .../Content/UGC/UGCYourReviewCell.swift | 69 -------- .../Content/UGC/UGCYourReviewCell.xib | 125 --------------- .../PlacePage/PlacePageViewController.swift | 37 ----- .../PlacePage/UGCViewModel/MWMUGCViewModel.h | 49 ------ .../PlacePage/UGCViewModel/MWMUGCViewModel.mm | 151 ------------------ iphone/Maps/UI/Reviews/MWMReviewProtocol.h | 4 - .../UI/Reviews/MWMReviewsViewModelProtocol.h | 8 - .../UI/Reviews/ReviewsViewController.swift | 61 ------- .../Maps/UI/Reviews/ReviewsViewController.xib | 25 --- 21 files changed, 4 insertions(+), 1003 deletions(-) delete mode 100644 iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReview.swift delete mode 100644 iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.swift delete mode 100644 iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.xib delete mode 100644 iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.swift delete mode 100644 iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.xib delete mode 100644 iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.swift delete mode 100644 iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.xib delete mode 100644 iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReview.swift delete mode 100644 iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.swift delete mode 100644 iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.xib delete mode 100644 iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.h delete mode 100644 iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.mm delete mode 100644 iphone/Maps/UI/Reviews/MWMReviewProtocol.h delete mode 100644 iphone/Maps/UI/Reviews/MWMReviewsViewModelProtocol.h delete mode 100644 iphone/Maps/UI/Reviews/ReviewsViewController.swift delete mode 100644 iphone/Maps/UI/Reviews/ReviewsViewController.xib diff --git a/iphone/Maps/Bridging-Header.h b/iphone/Maps/Bridging-Header.h index 9294c68875..86644a75cc 100644 --- a/iphone/Maps/Bridging-Header.h +++ b/iphone/Maps/Bridging-Header.h @@ -50,7 +50,6 @@ #import "MWMNoMapsViewController.h" #import "MWMPlacePageManagerHelper.h" #import "MWMPushNotifications.h" -#import "MWMReviewsViewModelProtocol.h" #import "MWMRouteManagerPointType.h" #import "MWMRoutePreviewTaxiCellType.h" #import "MWMRouter.h" diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 79ab2d7829..582603c309 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -87,14 +87,11 @@ 342639361EA0E60A0025EB89 /* local_ads_symbols.txt in Resources */ = {isa = PBXBuildFile; fileRef = 450703081E9E6CF000E8C029 /* local_ads_symbols.txt */; }; 342CC5F21C2D7730005F3FE5 /* MWMAuthorizationLoginViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 342CC5F01C2D7730005F3FE5 /* MWMAuthorizationLoginViewController.mm */; }; 342EE4121C43DAA7009F6A49 /* MWMAuthorizationWebViewLoginViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 342EE4101C43DAA7009F6A49 /* MWMAuthorizationWebViewLoginViewController.mm */; }; - 3430291D1F87BF4400D0A07C /* ReviewsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3430291A1F87BC3000D0A07C /* ReviewsViewController.swift */; }; 343064411E9FDC7300DC7665 /* SearchIndex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3430643F1E9FDC7300DC7665 /* SearchIndex.swift */; }; 343E75981E5B1EE20041226A /* MWMCollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 343E75961E5B1EE20041226A /* MWMCollectionViewController.m */; }; 3444DFCD1F1760B900E73099 /* WidgetsArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3444DFCB1F1760B900E73099 /* WidgetsArea.swift */; }; 3444DFD21F17620C00E73099 /* MWMMapWidgetsHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3444DFD01F17620C00E73099 /* MWMMapWidgetsHelper.mm */; }; 3444DFDE1F18A5AF00E73099 /* SideButtonsArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3444DFDC1F18A5AF00E73099 /* SideButtonsArea.swift */; }; - 344532311F6FE5880059FBCC /* UGCSummaryRatingStarsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3445322E1F6FE5880059FBCC /* UGCSummaryRatingStarsCell.swift */; }; - 344532341F6FE5880059FBCC /* UGCSummaryRatingStarsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3445322F1F6FE5880059FBCC /* UGCSummaryRatingStarsCell.xib */; }; 344532381F6FFE6A0059FBCC /* UGCRating.swift in Sources */ = {isa = PBXBuildFile; fileRef = 344532361F6FFE6A0059FBCC /* UGCRating.swift */; }; 3445324E1F714FD70059FBCC /* UGCAddReviewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3445324B1F714FD70059FBCC /* UGCAddReviewController.swift */; }; 344532511F714FD70059FBCC /* UGCAddReviewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3445324C1F714FD70059FBCC /* UGCAddReviewController.xib */; }; @@ -117,7 +114,6 @@ 3454D7E31E07F045004AF2AD /* UITextView+RuntimeAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = 3454D7B51E07F045004AF2AD /* UITextView+RuntimeAttributes.m */; }; 34574A671E3B85F80061E839 /* ThemeManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34574A651E3B85F80061E839 /* ThemeManager.swift */; }; 3457C4261F680F1900028233 /* String+BoundingRect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3457C4241F680F1900028233 /* String+BoundingRect.swift */; }; - 345C2F8A1F86361B009DB8B4 /* MWMUGCViewModel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 345C2F881F86361B009DB8B4 /* MWMUGCViewModel.mm */; }; 345E8F4E1F83984500A826CC /* GoogleSignIn.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 347D15C71F82362900E86251 /* GoogleSignIn.framework */; }; 345E8F4F1F83984500A826CC /* GoogleSignInDependencies.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 347D15C81F82362900E86251 /* GoogleSignInDependencies.framework */; }; 345E8F551F839E6C00A826CC /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 345E8F4D1F83976800A826CC /* GoogleService-Info.plist */; }; @@ -165,8 +161,6 @@ 348A8DF81F66775A00D83026 /* RatingViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 348A8DF21F66775A00D83026 /* RatingViewDelegate.swift */; }; 348A8DFB1F66775A00D83026 /* RatingViewSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 348A8DF31F66775A00D83026 /* RatingViewSettings.swift */; }; 348B926D1FF3B5E100379009 /* UIView+Animation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 348B926B1FF3B5E100379009 /* UIView+Animation.swift */; }; - 348F8A4F1F863A8500060C2A /* UGCYourReview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 348F8A4D1F863A8500060C2A /* UGCYourReview.swift */; }; - 348F8A531F863B6100060C2A /* UGCReview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 348F8A511F863B6100060C2A /* UGCReview.swift */; }; 3490D2DF1CE9DD2500D0B838 /* MWMSideButtons.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3490D2DA1CE9DD2500D0B838 /* MWMSideButtons.mm */; }; 3490D2E11CE9DD2500D0B838 /* MWMSideButtonsView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3490D2DC1CE9DD2500D0B838 /* MWMSideButtonsView.mm */; }; 3490D2E31CE9DD2500D0B838 /* MWMSideButtonsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3490D2DD1CE9DD2500D0B838 /* MWMSideButtonsView.xib */; }; @@ -282,12 +276,6 @@ 34D3B0481E389D05004100F9 /* MWMNoteCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D3B0151E389D05004100F9 /* MWMNoteCell.m */; }; 34D3B04B1E389D05004100F9 /* MWMNoteCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34D3B0161E389D05004100F9 /* MWMNoteCell.xib */; }; 34D3B04F1E38A20C004100F9 /* Bundle+Init.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34D3B04D1E38A20C004100F9 /* Bundle+Init.swift */; }; - 34E50DD81F6FCAB1008EED49 /* UGCSummaryRatingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34E50DD51F6FCAB1008EED49 /* UGCSummaryRatingCell.swift */; }; - 34E50DDB1F6FCAB1008EED49 /* UGCSummaryRatingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34E50DD61F6FCAB1008EED49 /* UGCSummaryRatingCell.xib */; }; - 34E50DF01F6FCC41008EED49 /* UGCYourReviewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34E50DED1F6FCC41008EED49 /* UGCYourReviewCell.swift */; }; - 34E50DF31F6FCC41008EED49 /* UGCYourReviewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34E50DEE1F6FCC41008EED49 /* UGCYourReviewCell.xib */; }; - 34E50DF81F6FCC96008EED49 /* UGCReviewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34E50DF51F6FCC96008EED49 /* UGCReviewCell.swift */; }; - 34E50DFB1F6FCC96008EED49 /* UGCReviewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34E50DF61F6FCC96008EED49 /* UGCReviewCell.xib */; }; 34E6F2DB1F459C05008E14F9 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34E6F2DA1F459C05008E14F9 /* GLKit.framework */; }; 34E776101F14B165003040B3 /* VisibleArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34E7760E1F14B165003040B3 /* VisibleArea.swift */; }; 34E776141F14B17F003040B3 /* AvailableArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34E776121F14B17F003040B3 /* AvailableArea.swift */; }; @@ -756,7 +744,6 @@ F6A2184A1CA3F26800BE2CC6 /* MWMEditorViralActivityItem.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6A218481CA3F26800BE2CC6 /* MWMEditorViralActivityItem.mm */; }; F6BD1D211CA412920047B8E8 /* MWMOsmAuthAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6BD1D1F1CA412920047B8E8 /* MWMOsmAuthAlert.mm */; }; F6BD1D241CA412E40047B8E8 /* MWMOsmAuthAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6BD1D221CA412E30047B8E8 /* MWMOsmAuthAlert.xib */; }; - F6C16A671F9626B2000FE296 /* ReviewsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3430291B1F87BC3000D0A07C /* ReviewsViewController.xib */; }; F6C3A1B221AC22810060EEC8 /* Alert 5.m4a in Resources */ = {isa = PBXBuildFile; fileRef = F6C3A1B121AC22810060EEC8 /* Alert 5.m4a */; }; F6D67CDC2062B9C00032FD38 /* BCCreateCategoryAlert.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6D67CDB2062B9C00032FD38 /* BCCreateCategoryAlert.swift */; }; F6D67CDE2062BBA60032FD38 /* MWMBCCreateCategoryAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6D67CDD2062BBA60032FD38 /* MWMBCCreateCategoryAlert.xib */; }; @@ -1005,8 +992,6 @@ 342CC5F01C2D7730005F3FE5 /* MWMAuthorizationLoginViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAuthorizationLoginViewController.mm; sourceTree = ""; }; 342EE40F1C43DAA7009F6A49 /* MWMAuthorizationWebViewLoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAuthorizationWebViewLoginViewController.h; sourceTree = ""; }; 342EE4101C43DAA7009F6A49 /* MWMAuthorizationWebViewLoginViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAuthorizationWebViewLoginViewController.mm; sourceTree = ""; }; - 3430291A1F87BC3000D0A07C /* ReviewsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewsViewController.swift; sourceTree = ""; }; - 3430291B1F87BC3000D0A07C /* ReviewsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ReviewsViewController.xib; sourceTree = ""; }; 3430643F1E9FDC7300DC7665 /* SearchIndex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchIndex.swift; sourceTree = ""; }; 343E75951E5B1EE20041226A /* MWMCollectionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMCollectionViewController.h; sourceTree = ""; }; 343E75961E5B1EE20041226A /* MWMCollectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMCollectionViewController.m; sourceTree = ""; }; @@ -1014,8 +999,6 @@ 3444DFCF1F17620C00E73099 /* MWMMapWidgetsHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMMapWidgetsHelper.h; sourceTree = ""; }; 3444DFD01F17620C00E73099 /* MWMMapWidgetsHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMMapWidgetsHelper.mm; sourceTree = ""; }; 3444DFDC1F18A5AF00E73099 /* SideButtonsArea.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideButtonsArea.swift; sourceTree = ""; }; - 3445322E1F6FE5880059FBCC /* UGCSummaryRatingStarsCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UGCSummaryRatingStarsCell.swift; sourceTree = ""; }; - 3445322F1F6FE5880059FBCC /* UGCSummaryRatingStarsCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UGCSummaryRatingStarsCell.xib; sourceTree = ""; }; 344532361F6FFE6A0059FBCC /* UGCRating.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UGCRating.swift; sourceTree = ""; }; 3445324B1F714FD70059FBCC /* UGCAddReviewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UGCAddReviewController.swift; sourceTree = ""; }; 3445324C1F714FD70059FBCC /* UGCAddReviewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UGCAddReviewController.xib; sourceTree = ""; }; @@ -1051,8 +1034,6 @@ 34570A3A1B13222600E6D4FD /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 34574A651E3B85F80061E839 /* ThemeManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThemeManager.swift; sourceTree = ""; }; 3457C4241F680F1900028233 /* String+BoundingRect.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+BoundingRect.swift"; sourceTree = ""; }; - 345C2F871F86361B009DB8B4 /* MWMUGCViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMUGCViewModel.h; sourceTree = ""; }; - 345C2F881F86361B009DB8B4 /* MWMUGCViewModel.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMUGCViewModel.mm; sourceTree = ""; }; 345E8F4D1F83976800A826CC /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 3462258C1DDC5DB9001E8752 /* MWMSearchNoResultsAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchNoResultsAlert.h; sourceTree = ""; }; 3462258D1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMSearchNoResultsAlert.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; @@ -1117,8 +1098,6 @@ 348A8DF21F66775A00D83026 /* RatingViewDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RatingViewDelegate.swift; sourceTree = ""; }; 348A8DF31F66775A00D83026 /* RatingViewSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RatingViewSettings.swift; sourceTree = ""; }; 348B926B1FF3B5E100379009 /* UIView+Animation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Animation.swift"; sourceTree = ""; }; - 348F8A4D1F863A8500060C2A /* UGCYourReview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UGCYourReview.swift; sourceTree = ""; }; - 348F8A511F863B6100060C2A /* UGCReview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UGCReview.swift; sourceTree = ""; }; 3490D2D91CE9DD2500D0B838 /* MWMSideButtons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSideButtons.h; sourceTree = ""; }; 3490D2DA1CE9DD2500D0B838 /* MWMSideButtons.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSideButtons.mm; sourceTree = ""; }; 3490D2DB1CE9DD2500D0B838 /* MWMSideButtonsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSideButtonsView.h; sourceTree = ""; }; @@ -1288,14 +1267,6 @@ 34D3B0161E389D05004100F9 /* MWMNoteCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMNoteCell.xib; sourceTree = ""; }; 34D3B04D1E38A20C004100F9 /* Bundle+Init.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Bundle+Init.swift"; sourceTree = ""; }; 34D7DB77204ED3DD0041D015 /* maps.me dbg.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "maps.me dbg.entitlements"; sourceTree = ""; }; - 34DFCD971F87ED2400AE2672 /* MWMReviewsViewModelProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMReviewsViewModelProtocol.h; sourceTree = ""; }; - 34DFCD981F87ED5600AE2672 /* MWMReviewProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMReviewProtocol.h; sourceTree = ""; }; - 34E50DD51F6FCAB1008EED49 /* UGCSummaryRatingCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UGCSummaryRatingCell.swift; sourceTree = ""; }; - 34E50DD61F6FCAB1008EED49 /* UGCSummaryRatingCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UGCSummaryRatingCell.xib; sourceTree = ""; }; - 34E50DED1F6FCC41008EED49 /* UGCYourReviewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UGCYourReviewCell.swift; sourceTree = ""; }; - 34E50DEE1F6FCC41008EED49 /* UGCYourReviewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UGCYourReviewCell.xib; sourceTree = ""; }; - 34E50DF51F6FCC96008EED49 /* UGCReviewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UGCReviewCell.swift; sourceTree = ""; }; - 34E50DF61F6FCC96008EED49 /* UGCReviewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UGCReviewCell.xib; sourceTree = ""; }; 34E6F2DA1F459C05008E14F9 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; 34E7270820444A7A009E4CED /* MWMAlertViewController+CPP.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MWMAlertViewController+CPP.h"; sourceTree = ""; }; 34E7270920444B95009E4CED /* MWMAlert+CPP.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MWMAlert+CPP.h"; sourceTree = ""; }; @@ -2641,17 +2612,6 @@ path = Storyboard; sourceTree = ""; }; - 343029191F87BBF300D0A07C /* Reviews */ = { - isa = PBXGroup; - children = ( - 3430291A1F87BC3000D0A07C /* ReviewsViewController.swift */, - 3430291B1F87BC3000D0A07C /* ReviewsViewController.xib */, - 34DFCD971F87ED2400AE2672 /* MWMReviewsViewModelProtocol.h */, - 34DFCD981F87ED5600AE2672 /* MWMReviewProtocol.h */, - ); - path = Reviews; - sourceTree = ""; - }; 3432E17F1E49BEFA008477E9 /* Ads */ = { isa = PBXGroup; children = ( @@ -3339,13 +3299,12 @@ path = RB; sourceTree = ""; }; - 34F4B0641F6AC6890035F4F3 /* UGCViewModel */ = { + 34F407591E9E1D7A00E57AC0 /* Products */ = { isa = PBXGroup; children = ( - 345C2F871F86361B009DB8B4 /* MWMUGCViewModel.h */, - 345C2F881F86361B009DB8B4 /* MWMUGCViewModel.mm */, + 34F4075D1E9E1D7A00E57AC0 /* libMopub.a */, ); - path = UGCViewModel; + name = Products; sourceTree = ""; }; 34F73F5E1E082FF700AC1FD6 /* LocalizedStrings */ = { @@ -4205,16 +4164,6 @@ children = ( 3445324A1F714FD70059FBCC /* UGCAddReview */, 344532361F6FFE6A0059FBCC /* UGCRating.swift */, - 348F8A511F863B6100060C2A /* UGCReview.swift */, - 34E50DF51F6FCC96008EED49 /* UGCReviewCell.swift */, - 34E50DF61F6FCC96008EED49 /* UGCReviewCell.xib */, - 34E50DD51F6FCAB1008EED49 /* UGCSummaryRatingCell.swift */, - 34E50DD61F6FCAB1008EED49 /* UGCSummaryRatingCell.xib */, - 3445322E1F6FE5880059FBCC /* UGCSummaryRatingStarsCell.swift */, - 3445322F1F6FE5880059FBCC /* UGCSummaryRatingStarsCell.xib */, - 348F8A4D1F863A8500060C2A /* UGCYourReview.swift */, - 34E50DED1F6FCC41008EED49 /* UGCYourReviewCell.swift */, - 34E50DEE1F6FCC41008EED49 /* UGCYourReviewCell.xib */, ); path = UGC; sourceTree = ""; @@ -4273,7 +4222,6 @@ F6E2FC321E097B9F0083EBEC /* Editor */, F6E2FC8F1E097B9F0083EBEC /* PlacePage */, 3DB1C56F22D5DCF20097EC4C /* Promo */, - 343029191F87BBF300D0A07C /* Reviews */, F6E2FCE11E097B9F0083EBEC /* Search */, F6E2FD361E097BA00083EBEC /* Settings */, 340E1EE31E2F614400CE49BF /* Storyboard */, @@ -4455,7 +4403,6 @@ F6E2FC8F1E097B9F0083EBEC /* PlacePage */ = { isa = PBXGroup; children = ( - 34F4B0641F6AC6890035F4F3 /* UGCViewModel */, F6E2FC931E097B9F0083EBEC /* DirectionView */, F6E2FC991E097B9F0083EBEC /* MWMPlacePageManager.h */, F6E2FC9A1E097B9F0083EBEC /* MWMPlacePageManager.mm */, @@ -4920,7 +4867,7 @@ F6C3A1B221AC22810060EEC8 /* Alert 5.m4a in Resources */, 4560F585213D53C100CC736C /* shaders_metal.metallib in Resources */, F642D1231F0F9D1D005E3C25 /* ugc_types.csv in Resources */, - 34E50DFB1F6FCC96008EED49 /* UGCReviewCell.xib in Resources */, + 3495433D1EB22D9600F08F73 /* MPAdBrowserController.xib in Resources */, 6741A9531BF340DE002C974C /* 01_dejavusans.ttf in Resources */, 6741A9541BF340DE002C974C /* 02_droidsans-fallback.ttf in Resources */, 479D305B22C62F4000D18278 /* MWMBookmarksBannerViewController.xib in Resources */, @@ -4986,7 +4933,6 @@ 34D3B0241E389D05004100F9 /* MWMEditorAddAdditionalNameTableViewCell.xib in Resources */, 34AB667A1FC5AA330078E451 /* RoutePreviewTaxiCell.xib in Resources */, 34D3B0271E389D05004100F9 /* EditorAdditionalNamePlaceholderTableViewCell.xib in Resources */, - 34E50DDB1F6FCAB1008EED49 /* UGCSummaryRatingCell.xib in Resources */, 47B505542136B0C2009CBB55 /* DiscoveryTutorialBlur.xib in Resources */, F6E2FDB91E097BA00083EBEC /* MWMEditorAdditionalNamesHeader.xib in Resources */, 34D3B02D1E389D05004100F9 /* MWMEditorAdditionalNameTableViewCell.xib in Resources */, @@ -5040,7 +4986,6 @@ F6E2FE0D1E097BA00083EBEC /* MWMOpeningHoursDeleteScheduleTableViewCell.xib in Resources */, F6E2FE161E097BA00083EBEC /* MWMOpeningHoursTimeSelectorTableViewCell.xib in Resources */, F6E2FE1C1E097BA00083EBEC /* MWMOpeningHoursTimeSpanTableViewCell.xib in Resources */, - F6C16A671F9626B2000FE296 /* ReviewsViewController.xib in Resources */, F6BD1D241CA412E40047B8E8 /* MWMOsmAuthAlert.xib in Resources */, F6FE3C3C1CC5106500A73196 /* MWMPlaceDoesntExistAlert.xib in Resources */, F6E407D41FC4722F001F7821 /* MWMDiscoveryController.xib in Resources */, @@ -5085,7 +5030,6 @@ 3463BA691DE81DB90082417F /* MWMTrafficButtonViewController.xib in Resources */, F623DA6C1C9C2731006A3436 /* opening_hours_how_to_edit.html in Resources */, 47E6CB0C2178BA3600EA102B /* SearchBannerCell.xib in Resources */, - 344532341F6FE5880059FBCC /* UGCSummaryRatingStarsCell.xib in Resources */, 6741A9761BF340DE002C974C /* packed_polygons.bin in Resources */, 470A8A012136097000D72FBF /* SubwayTutorialBlur.xib in Resources */, 676507601C10559800830BB3 /* patterns.txt in Resources */, @@ -5112,7 +5056,6 @@ 3D0D2F7623D858BF00945C8D /* IsolinesTutorialBlur.xib in Resources */, 47B505552136B0CF009CBB55 /* SearchTutorialBlur.xib in Resources */, 6741A97D1BF340DE002C974C /* synonyms.txt in Resources */, - 34E50DF31F6FCC41008EED49 /* UGCYourReviewCell.xib in Resources */, CDB4D4D7222D248900104869 /* CarPlayStoryboard.storyboard in Resources */, 47C8789122DF525A00A772DA /* SubscriptionSuccessViewController.xib in Resources */, 4707E4B42372FF480017DF6E /* PlacePage.storyboard in Resources */, @@ -5281,7 +5224,6 @@ 34D3B0211E389D05004100F9 /* MWMEditorAddAdditionalNameTableViewCell.m in Sources */, 999FC12923ABAFFE00B0E6F9 /* GlobalStyleSheet.swift in Sources */, 99D363192358685300941BF4 /* SubscriptionGroupItem.swift in Sources */, - 348F8A531F863B6100060C2A /* UGCReview.swift in Sources */, 340475501E081A4600C92850 /* fabric_logging_ios.mm in Sources */, CDCA273A2237FCFE00167D87 /* SearchTemplateBuilder.swift in Sources */, 34F4073E1E9E1AFF00E57AC0 /* MPNativeAd+MWM.m in Sources */, @@ -5320,7 +5262,6 @@ 4738A8E7239FC513007C0F43 /* AdBannerView.swift in Sources */, 349D1ABC1E2D05EF004A2006 /* SearchBar.swift in Sources */, 993F5511237C622700545511 /* DeepLinkCatalogueStrategy.swift in Sources */, - 34E50DF81F6FCC96008EED49 /* UGCReviewCell.swift in Sources */, F6E2FF3F1E097BA00083EBEC /* MWMSearchTableViewController.mm in Sources */, F6E2FDE01E097BA00083EBEC /* MWMEditorViewController.mm in Sources */, 99DEF9D023E2CD67006BFD21 /* UISearchBar+swizzle.m in Sources */, @@ -5592,7 +5533,6 @@ F6E2FE041E097BA00083EBEC /* MWMOpeningHoursDaysSelectorTableViewCell.mm in Sources */, 472E3F472146BCD30020E412 /* SubscriptionManager.swift in Sources */, F6E2FE131E097BA00083EBEC /* MWMOpeningHoursTimeSelectorTableViewCell.mm in Sources */, - 344532311F6FE5880059FBCC /* UGCSummaryRatingStarsCell.swift in Sources */, 478F6FA623C4521F00054A53 /* MoreReviewsViewController.swift in Sources */, F626D52F1C3E83F800C17D15 /* MWMTableViewCell.m in Sources */, 34AB66591FC5AA330078E451 /* TransportTransitFlowLayout.swift in Sources */, @@ -5635,7 +5575,6 @@ 34BBD6601F8270360070CA50 /* AuthorizationiPadPresentationController.swift in Sources */, F6E2FED31E097BA00083EBEC /* MWMSearchHotelsFilterViewController.mm in Sources */, 347752901F7251C7000D46A3 /* UGCAddReviewTextCell.swift in Sources */, - 34E50DF01F6FCC41008EED49 /* UGCYourReviewCell.swift in Sources */, 34AB66381FC5AA330078E451 /* RouteManagerCell.swift in Sources */, CD4A1F132305872700F2A6B6 /* PromoBookingPresentationController.swift in Sources */, 3472B5D3200F501500DC6CD5 /* BackgroundFetchTaskFrameworkType.swift in Sources */, @@ -5654,7 +5593,6 @@ 47289E5A2212DFFF002ABFC0 /* EditOnWebAlertViewController.swift in Sources */, 34763EE71F2F392300F4D2D3 /* MWMTextToSpeech.mm in Sources */, 34ABA6251C2D551900FE1BEC /* MWMInputValidatorFactory.m in Sources */, - 348F8A4F1F863A8500060C2A /* UGCYourReview.swift in Sources */, 999FC12223ABABA000B0E6F9 /* IFonts.swift in Sources */, F6E2FEE21E097BA00083EBEC /* MWMSearchManager.mm in Sources */, F6E2FE221E097BA00083EBEC /* MWMOpeningHoursEditorViewController.mm in Sources */, @@ -5678,7 +5616,6 @@ 993F550F237C622700545511 /* DeepLinkMapStrategy.swift in Sources */, 34AB661A1FC5AA330078E451 /* MWMTaxiCollectionLayout.m in Sources */, 994AEC2B23AB763C0079B81F /* SwizzleStyle.m in Sources */, - 345C2F8A1F86361B009DB8B4 /* MWMUGCViewModel.mm in Sources */, 33F8BA4E2199AB9500ECA8EE /* TagsDataSource.swift in Sources */, 993F5507237C622700545511 /* DeepLinkSearchStrategy.swift in Sources */, 994AEC1723AB763C0079B81F /* UIImageRenderer.swift in Sources */, @@ -5729,7 +5666,6 @@ 3404754D1E081A4600C92850 /* MWMKeyboard.m in Sources */, 3457C4261F680F1900028233 /* String+BoundingRect.swift in Sources */, 34EF94291C05A6F30050B714 /* MWMSegue.m in Sources */, - 3430291D1F87BF4400D0A07C /* ReviewsViewController.swift in Sources */, CD96C70C22A681C400DB7CFE /* DiscoveryGuideCell.swift in Sources */, 47E3C7312111F4C2008B3B27 /* CoverVerticalPresentationAnimator.swift in Sources */, 99E2B0122368A8C700FFABC5 /* MWMCategory+PlacesCountTitle.swift in Sources */, @@ -5757,7 +5693,6 @@ 34AB39C21D2BD8310021857D /* MWMStopButton.m in Sources */, 995739082355CB660019AEE7 /* AllPassSubscriptionViewController.swift in Sources */, 3488B01A1E9D0B230068AFD8 /* UIColor+Modifications.swift in Sources */, - 34E50DD81F6FCAB1008EED49 /* UGCSummaryRatingCell.swift in Sources */, 1185C52C23BB53A7004BF349 /* UIViewControllerRenderer.swift in Sources */, 6741AA281BF340DE002C974C /* MWMAlert.mm in Sources */, F6E2FF571E097BA00083EBEC /* MWMMobileInternetViewController.m in Sources */, diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm index b528f06240..1522cd935f 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm @@ -444,12 +444,6 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type) [self.ownerViewController openUrl:url]; } -- (void)openReviews:(id _Nonnull)reviewsViewModel -{ - auto reviewsVC = [[MWMReviewsViewController alloc] initWithViewModel:reviewsViewModel]; - [[MapViewController sharedController].navigationController pushViewController:reviewsVC animated:YES]; -} - - (void)openWebsite:(PlacePageData *)data { NSURL *url = [NSURL URLWithString:data.infoData.website]; if (url) { diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCRating.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCRating.swift index a634c7e630..b468368f86 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCRating.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCRating.swift @@ -1,15 +1,3 @@ -@objc(MWMUGCRatingValueType) -class UGCRatingValueType: NSObject { - let value: String - let type: UgcSummaryRatingType - - @objc init(value: String, type: UgcSummaryRatingType) { - self.value = value - self.type = type - super.init() - } -} - @objc(MWMUGCRatingStars) final class UGCRatingStars: NSObject { @objc let title: String diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReview.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReview.swift deleted file mode 100644 index f0bf756d2e..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReview.swift +++ /dev/null @@ -1,14 +0,0 @@ -@objc(MWMUGCReview) -final class UGCReview: NSObject, MWMReviewProtocol { - let title: String - let date: String - let text: String - let rating: UGCRatingValueType - - @objc init(title: String, date: String, text: String, rating: UGCRatingValueType) { - self.title = title - self.date = date - self.text = text - self.rating = rating - } -} diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.swift deleted file mode 100644 index 5fcdf71d89..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.swift +++ /dev/null @@ -1,26 +0,0 @@ -@objc(MWMUGCReviewCell) -final class UGCReviewCell: MWMTableViewCell { - @IBOutlet private weak var titleLabel: UILabel! - @IBOutlet private weak var dateLabel: UILabel! - @IBOutlet private weak var ratingView: RatingSummaryView! - @IBOutlet private weak var reviewLabel: ExpandableReviewView! { - didSet { - let settings = ExpandableReviewSettings(expandText: L("placepage_more_button"), - expandTextColor: .linkBlue(), - textColor: .blackPrimaryText(), - textFont: .regular14()) - reviewLabel.apply(settings: settings) - } - } - - @objc func config(review: UGCReview, isExpanded: Bool, onUpdate: @escaping () -> Void) { - titleLabel.text = review.title - dateLabel.text = review.date - reviewLabel.configure(text: review.text, - isExpanded: isExpanded, - onUpdate: onUpdate) - ratingView.value = review.rating.value - ratingView.type = review.rating.type - isSeparatorHidden = true - } -} diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.xib b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.xib deleted file mode 100644 index 612fc82113..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.xib +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.swift deleted file mode 100644 index 7f4a268217..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.swift +++ /dev/null @@ -1,54 +0,0 @@ -@objc(MWMUGCSummaryRatingCell) -final class UGCSummaryRatingCell: MWMTableViewCell { - @IBOutlet private weak var titleLabel: UILabel! - @IBOutlet private weak var countLabel: UILabel! - @IBOutlet private weak var ratingSummaryView: RatingSummaryView! - @IBOutlet private weak var ratingCollectionViewHeight: NSLayoutConstraint! - @IBOutlet private weak var ratingCollectionView: UICollectionView! { - didSet { - ratingCollectionView.register(cellClass: UGCSummaryRatingStarsCell.self) - } - } - - fileprivate var ratings: [UGCRatingStars]! - - override var frame: CGRect { - didSet { - if frame.size != oldValue.size { - updateCollectionView() - } - } - } - - @objc func config(reviewsCount: UInt, summaryRating: UGCRatingValueType, ratings: [UGCRatingStars]) { - countLabel.text = String(format:L("placepage_summary_rating_description"), reviewsCount) - ratingSummaryView.value = summaryRating.value - ratingSummaryView.type = summaryRating.type - self.ratings = ratings - updateCollectionView() - isSeparatorHidden = true - } - - override func didMoveToSuperview() { - super.didMoveToSuperview() - updateCollectionView() - } - - private func updateCollectionView() { - DispatchQueue.main.async { - self.ratingCollectionView.reloadData() - } - } -} - -extension UGCSummaryRatingCell: UICollectionViewDataSource { - func collectionView(_: UICollectionView, numberOfItemsInSection _: Int) -> Int { - return ratings?.count ?? 0 - } - - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell = collectionView.dequeueReusableCell(withCellClass: UGCSummaryRatingStarsCell.self, indexPath: indexPath) as! UGCSummaryRatingStarsCell - cell.config(rating: ratings[indexPath.item]) - return cell - } -} diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.xib b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.xib deleted file mode 100644 index 39b2a603d9..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.xib +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.swift deleted file mode 100644 index f8b9e80c76..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.swift +++ /dev/null @@ -1,10 +0,0 @@ - -final class UGCSummaryRatingStarsCell: UICollectionViewCell { - @IBOutlet private weak var ratingView: RatingView! - - func config(rating: UGCRatingStars) { - ratingView.topText = L(rating.title) - ratingView.value = rating.value - ratingView.starsCount = Int(rating.maxValue) - } -} diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.xib b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.xib deleted file mode 100644 index bd1d856686..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.xib +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReview.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReview.swift deleted file mode 100644 index 3c3b2f5ec4..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReview.swift +++ /dev/null @@ -1,12 +0,0 @@ -@objc(MWMUGCYourReview) -final class UGCYourReview: NSObject, MWMReviewProtocol { - let date: String - let text: String - let ratings: [UGCRatingStars] - - @objc init(date: String, text: String, ratings: [UGCRatingStars]) { - self.date = date - self.text = text - self.ratings = ratings - } -} diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.swift deleted file mode 100644 index 62c90d4e96..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.swift +++ /dev/null @@ -1,69 +0,0 @@ -@objc(MWMUGCYourReviewCell) -final class UGCYourReviewCell: MWMTableViewCell { - private enum Config { - static let defaultReviewBottomOffset: CGFloat = 16 - } - - @IBOutlet private weak var titleLabel: UILabel! - @IBOutlet private weak var dateLabel: UILabel! - @IBOutlet private weak var reviewLabel: ExpandableReviewView! { - didSet { - let settings = ExpandableReviewSettings(expandText: L("placepage_more_button"), - expandTextColor: .linkBlue(), - textColor: .blackPrimaryText(), - textFont: .regular14()) - reviewLabel.apply(settings: settings) - } - } - - @IBOutlet private weak var reviewBottomOffset: NSLayoutConstraint! - @IBOutlet private weak var ratingCollectionView: UICollectionView! { - didSet { - ratingCollectionView.register(cellClass: UGCSummaryRatingStarsCell.self) - } - } - - private var yourReview: UGCYourReview! - - override var frame: CGRect { - didSet { - if frame.size != oldValue.size { - updateCollectionView() - } - } - } - - @objc func config(yourReview: UGCYourReview, isExpanded: Bool, onUpdate: @escaping () -> Void) { - dateLabel.text = yourReview.date - self.yourReview = yourReview - reviewLabel.configure(text: yourReview.text, - isExpanded: isExpanded, - onUpdate: onUpdate) - reviewBottomOffset.constant = yourReview.text.isEmpty ? 0 : Config.defaultReviewBottomOffset - updateCollectionView() - isSeparatorHidden = true - } - - override func didMoveToSuperview() { - super.didMoveToSuperview() - updateCollectionView() - } - - private func updateCollectionView() { - DispatchQueue.main.async { - self.ratingCollectionView.reloadData() - } - } -} - -extension UGCYourReviewCell: UICollectionViewDataSource { - func collectionView(_: UICollectionView, numberOfItemsInSection _: Int) -> Int { - return yourReview?.ratings.count ?? 0 - } - - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell = collectionView.dequeueReusableCell(withCellClass: UGCSummaryRatingStarsCell.self, indexPath: indexPath) as! UGCSummaryRatingStarsCell - cell.config(rating: yourReview!.ratings[indexPath.item]) - return cell - } -} diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.xib b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.xib deleted file mode 100644 index 3a3317b063..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.xib +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iphone/Maps/UI/PlacePage/PlacePageViewController.swift b/iphone/Maps/UI/PlacePage/PlacePageViewController.swift index 6a152227c5..b18487d83f 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageViewController.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageViewController.swift @@ -677,40 +677,3 @@ extension PlacePageViewController: MWMLocationObserver { } } - -extension UgcData: MWMReviewsViewModelProtocol { - public func numberOfReviews() -> Int { - reviews.count - } - - public func review(with index: Int) -> MWMReviewProtocol { - UgcReviewAdapter(reviews[index]) - } - - public func isExpanded(_ review: MWMReviewProtocol) -> Bool { - false - } - - public func markExpanded(_ review: MWMReviewProtocol) { - - } -} - -class UgcReviewAdapter: MWMReviewProtocol { - var date: String { - let formatter = DateFormatter() - formatter.dateStyle = .long - formatter.timeStyle = .none - return formatter.string(from: ugcReview.date) - } - - var text: String { - ugcReview.text - } - - private let ugcReview: UgcReview - init(_ review: UgcReview) { - ugcReview = review - } -} - diff --git a/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.h b/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.h deleted file mode 100644 index f70dc1b212..0000000000 --- a/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.h +++ /dev/null @@ -1,49 +0,0 @@ -#import "MWMReviewsViewModelProtocol.h" - -#include - -typedef NS_ENUM(NSUInteger, MWMUGCViewModelPrice) { - MWMUGCViewModelPriceLow, - MWMUGCViewModelPriceMedium, - MWMUGCViewModelPriceHigh -}; - -namespace ugc -{ -struct UGC; -struct UGCUpdate; - -namespace view_model -{ -enum class ReviewRow -{ - YourReview, - Review, - MoreReviews -}; -} // namespace view_model -} // namespace ugc - -@class MWMUGCRatingValueType; -@class MWMUGCRatingStars; -@class MWMUGCYourReview; -@class MWMUGCReview; -@protocol MWMReviewsViewModelProtocol; - -@interface MWMUGCViewModel : NSObject - -- (instancetype)initWithUGC:(ugc::UGC const &)ugc update:(ugc::UGCUpdate const &)update; - -- (BOOL)isUGCEmpty; -- (BOOL)isUGCUpdateEmpty; -- (BOOL)isAggregatedRatingEmpty; - -- (NSUInteger)ratingCellsCount; -- (NSUInteger)addReviewCellsCount; -- (std::vector const &)reviewRows; - -- (NSUInteger)numberOfRatings; -- (MWMUGCRatingValueType *)summaryRating; -- (NSArray *)ratings; - -@end diff --git a/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.mm b/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.mm deleted file mode 100644 index f161d5ca47..0000000000 --- a/iphone/Maps/UI/PlacePage/UGCViewModel/MWMUGCViewModel.mm +++ /dev/null @@ -1,151 +0,0 @@ -#import "MWMUGCViewModel.h" -#import "SwiftBridge.h" - -#include "map/place_page_info.hpp" - -using namespace place_page; - -namespace -{ -NSArray * starsRatings(ugc::Ratings const & ratings) -{ - NSMutableArray * mwmRatings = [@[] mutableCopy]; - for (auto const & rec : ratings) - [mwmRatings addObject:[[MWMUGCRatingStars alloc] initWithTitle:@(rec.m_key.m_key.c_str()) - value:rec.m_value - maxValue:5]]; - return [mwmRatings copy]; -} - -UgcSummaryRatingType ratingValueType(rating::Impress impress) -{ - switch (impress) - { - case rating::Impress::None: return UgcSummaryRatingTypeNone; - case rating::Impress::Horrible: return UgcSummaryRatingTypeHorrible; - case rating::Impress::Bad: return UgcSummaryRatingTypeBad; - case rating::Impress::Normal: return UgcSummaryRatingTypeNormal; - case rating::Impress::Good: return UgcSummaryRatingTypeGood; - case rating::Impress::Excellent: return UgcSummaryRatingTypeExcellent; - } -} - -MWMUGCRatingValueType * ratingValueType(float rating) -{ - NSString *value = @(rating::GetRatingFormatted(rating).c_str()); - return [[MWMUGCRatingValueType alloc] - initWithValue:value ?: @"" - type:ratingValueType(rating::GetImpress(rating))]; -} -} // namespace - -@interface MWMUGCViewModel () -@property(copy, nonatomic) MWMVoidBlock refreshCallback; -@property(strong, nonatomic) NSMutableDictionary *expandedReviews; -@end - -@implementation MWMUGCViewModel -{ - ugc::UGC m_ugc; - ugc::UGCUpdate m_ugcUpdate; - std::vector m_reviewRows; -} - -- (instancetype)initWithUGC:(ugc::UGC const &)ugc update:(ugc::UGCUpdate const &)update -{ - self = [super init]; - if (self) - { - _expandedReviews = [[NSMutableDictionary alloc] initWithCapacity: 1]; - m_ugc = ugc; - m_ugcUpdate = update; - [self fillReviewRows]; - } - return self; -} - -- (void)fillReviewRows -{ - using namespace ugc::view_model; - m_reviewRows.clear(); - if (!m_ugcUpdate.IsEmpty()) - m_reviewRows.push_back(ReviewRow::YourReview); - - if (m_ugc.IsEmpty()) - return; - - auto const reviewsSize = m_ugc.m_reviews.size(); - auto constexpr kMaxSize = 3; - if (reviewsSize > kMaxSize) - { - m_reviewRows.insert(m_reviewRows.end(), kMaxSize, ReviewRow::Review); - m_reviewRows.push_back(ReviewRow::MoreReviews); - } - else - { - m_reviewRows.insert(m_reviewRows.end(), reviewsSize, ReviewRow::Review); - } -} - -- (BOOL)isUGCEmpty { return static_cast(m_ugc.IsEmpty()); } -- (BOOL)isUGCUpdateEmpty { return static_cast(m_ugcUpdate.IsEmpty()); } -- (BOOL)isAggregatedRatingEmpty { return m_ugc.m_totalRating == kIncorrectRating; } -- (NSUInteger)ratingCellsCount { return 1; } -- (NSUInteger)addReviewCellsCount { return 1; } -- (NSUInteger)numberOfRatings { return static_cast(m_ugc.m_basedOn); } -- (MWMUGCRatingValueType *)summaryRating { return ratingValueType(m_ugc.m_totalRating); } -- (NSArray *)ratings { return starsRatings(m_ugc.m_ratings); } -- (std::vector const &)reviewRows { return m_reviewRows; } - -#pragma mark - MWMReviewsViewModelProtocol - -- (NSInteger)numberOfReviews { return m_ugc.m_reviews.size() + !self.isUGCUpdateEmpty; } - -- (id _Nonnull)reviewWithIndex:(NSInteger)index -{ - auto idx = index; - NSAssert(idx >= 0, @"Invalid index"); - if (!self.isUGCUpdateEmpty) - { - if (idx == 0) - { - auto const & review = m_ugcUpdate; - return [[MWMUGCYourReview alloc] - initWithDate:[self reviewDate:review.m_time] - text:@(review.m_text.m_text.c_str()) - ratings:starsRatings(review.m_ratings)]; - } - idx -= 1; - } - NSAssert(idx < m_ugc.m_reviews.size(), @"Invalid index"); - auto const & review = m_ugc.m_reviews[idx]; - return [[MWMUGCReview alloc] - initWithTitle:@(review.m_author.c_str()) - date:[self reviewDate:review.m_time] - text:@(review.m_text.m_text.c_str()) - rating:ratingValueType(review.m_rating)]; -} - -- (BOOL)isExpanded:(id _Nonnull) review { - NSString *key = [[NSString alloc] initWithFormat:@"%@%lu", review.date, (unsigned long)[review.text hash]]; - return _expandedReviews[key] == nil ? NO : YES; -} - -- (void)markExpanded:(id _Nonnull) review { - NSString *key = [[NSString alloc] initWithFormat:@"%@%lu", review.date, (unsigned long)[review.text hash]]; - _expandedReviews[key] = @YES; -} - -#pragma mark - Propertis - -- (NSString *)reviewDate:(ugc::Time const &) time -{ - using namespace std::chrono; - auto reviewDate = [NSDate dateWithTimeIntervalSince1970:duration_cast(time.time_since_epoch()).count()]; - auto formatter = [[NSDateFormatter alloc] init]; - formatter.dateStyle = NSDateFormatterLongStyle; - formatter.timeStyle = NSDateFormatterNoStyle; - return [formatter stringFromDate:reviewDate]; -} - -@end diff --git a/iphone/Maps/UI/Reviews/MWMReviewProtocol.h b/iphone/Maps/UI/Reviews/MWMReviewProtocol.h deleted file mode 100644 index 11303b5e22..0000000000 --- a/iphone/Maps/UI/Reviews/MWMReviewProtocol.h +++ /dev/null @@ -1,4 +0,0 @@ -@protocol MWMReviewProtocol -@property(nonatomic, readonly, copy) NSString * _Nonnull date; -@property(nonatomic, readonly, copy) NSString * _Nonnull text; -@end diff --git a/iphone/Maps/UI/Reviews/MWMReviewsViewModelProtocol.h b/iphone/Maps/UI/Reviews/MWMReviewsViewModelProtocol.h deleted file mode 100644 index 9c6a09bc9c..0000000000 --- a/iphone/Maps/UI/Reviews/MWMReviewsViewModelProtocol.h +++ /dev/null @@ -1,8 +0,0 @@ -#import "MWMReviewProtocol.h" - -@protocol MWMReviewsViewModelProtocol -- (NSInteger)numberOfReviews; -- (id _Nonnull)reviewWithIndex:(NSInteger)index; -- (BOOL)isExpanded:(id _Nonnull) review; -- (void)markExpanded:(id _Nonnull) review; -@end diff --git a/iphone/Maps/UI/Reviews/ReviewsViewController.swift b/iphone/Maps/UI/Reviews/ReviewsViewController.swift deleted file mode 100644 index 199d1577be..0000000000 --- a/iphone/Maps/UI/Reviews/ReviewsViewController.swift +++ /dev/null @@ -1,61 +0,0 @@ -@objc(MWMReviewsViewController) -final class ReviewsViewController: MWMTableViewController { - private let viewModel: MWMReviewsViewModelProtocol - - @objc init(viewModel: MWMReviewsViewModelProtocol) { - self.viewModel = viewModel - super.init(nibName: toString(type(of: self)), bundle: nil) - } - - required init?(coder _: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override func viewDidLoad() { - super.viewDidLoad() - registerCells() - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - tableView.refresh() - } - - private func registerCells() { - [UGCYourReviewCell.self, UGCReviewCell.self].forEach { - tableView.register(cellClass: $0) - } - } - - override func tableView(_: UITableView, numberOfRowsInSection _: Int) -> Int { - return viewModel.numberOfReviews() - } - - override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cellModel = viewModel.review(with: indexPath.row) - switch cellModel { - case let cellModel as UGCYourReview: - let cell = tableView.dequeueReusableCell(withCellClass: UGCYourReviewCell.self, indexPath: indexPath) as! UGCYourReviewCell - cell.config(yourReview: cellModel, - isExpanded: viewModel.isExpanded(cellModel), - onUpdate: { [weak self] in - guard let self = self else { return } - self.viewModel.markExpanded(cellModel) - self.tableView.refresh() - }) - return cell - case let cellModel as UGCReview: - let cell = tableView.dequeueReusableCell(withCellClass: UGCReviewCell.self, indexPath: indexPath) as! UGCReviewCell - cell.config(review: cellModel, - isExpanded: viewModel.isExpanded(cellModel), - onUpdate: { [weak self] in - guard let self = self else { return } - self.viewModel.markExpanded(cellModel) - self.tableView.refresh() - }) - return cell - default: assert(false) - } - return UITableViewCell() - } -} diff --git a/iphone/Maps/UI/Reviews/ReviewsViewController.xib b/iphone/Maps/UI/Reviews/ReviewsViewController.xib deleted file mode 100644 index 4d316a7bbe..0000000000 --- a/iphone/Maps/UI/Reviews/ReviewsViewController.xib +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -