[iOS] Fixed the logic for displaying the tutorial

This commit is contained in:
Zoia Pribytkova 2019-08-20 16:24:42 +03:00 committed by Aleksandr Zatsepin
parent c6c380cfba
commit 3d0c9fc4d9
5 changed files with 15 additions and 3 deletions

View file

@ -2,6 +2,7 @@
#import "MWMAddPlaceNavigationBar.h"
#import "MWMBottomMenuControllerProtocol.h"
#import "MWMCommon.h"
#import "MWMMapDownloadDialog.h"
#import "MWMNetworkPolicy.h"
#import "MWMPlacePageManager.h"
#import "MWMPlacePageProtocol.h"
@ -471,14 +472,18 @@ extern NSString * const kAlohalyticsTapEventKey;
- (BOOL)showTutorialIfNeeded {
if (self.tutorialViewContoller != nil)
return YES;
auto ownerController = self.ownerController;
if ([self.placePageManager isPPShown] || ownerController.downloadDialog.superview != nil) {
return NO;
}
self.tutorialType = [MWMEye getTipType];
self.tutorialViewContoller = [self tutorialWithType:self.tutorialType];
if (!self.tutorialViewContoller)
return NO;
auto ownerController = self.ownerController;
[self logTutorialEvent:kStatTipsTricksShow additionalOptions:nil];
self.hidden = NO;
[ownerController addChildViewController:self.tutorialViewContoller];

View file

@ -8,6 +8,7 @@
@class MWMAPIBar;
@class MWMPlacePageData;
@class EAGLView;
@class MWMMapDownloadDialog;
@protocol MWMLocationModeListener;
@interface MapViewController : MWMViewController
@ -51,6 +52,7 @@
@property(nonatomic, readonly) MWMMapViewControlsManager * controlsManager;
@property(nonatomic) MWMAPIBar * apiBar;
@property(nonatomic) MWMWelcomePageController * welcomePageController;
@property(nonatomic, readonly) MWMMapDownloadDialog * downloadDialog;
@property(nonatomic) MWMMyPositionMode currentPositionMode;

View file

@ -87,7 +87,7 @@ NSString * const kHotelFacilitiesSegue = @"Map2FacilitiesSegue";
@property(nonatomic) UserTouchesAction userTouchesAction;
@property(nonatomic) MWMMapDownloadDialog * downloadDialog;
@property(nonatomic, readwrite) MWMMapDownloadDialog * downloadDialog;
@property(nonatomic) BOOL skipForceTouch;

View file

@ -129,6 +129,10 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page:
[self processCountryEvent:[self.data countryId]];
}
- (BOOL)isPPShown {
return self.data != nil;
}
- (void)dismiss
{
[self.layout close];

View file

@ -51,6 +51,7 @@ struct HotelFacility;
- (void)show:(place_page::Info const &)info;
- (void)showReview:(place_page::Info const &)info;
- (BOOL)isPPShown;
- (void)dismiss;
- (void)mwm_refreshUI;
- (void)didBecomeActive;