diff --git a/iphone/Maps/Categories/UIKitCategories.h b/iphone/Maps/Categories/UIKitCategories.h index dab0aafda5..63acc0e2c5 100644 --- a/iphone/Maps/Categories/UIKitCategories.h +++ b/iphone/Maps/Categories/UIKitCategories.h @@ -21,7 +21,7 @@ static inline CGFloat LengthCGPoint(CGPoint point) @interface NSObject (Optimized) + (NSString *)className; -- (void)performAfterDelay:(NSTimeInterval)delayInSec block:(TMWMVoidBlock)block; +- (void)performAfterDelay:(NSTimeInterval)delayInSec block:(MWMVoidBlock)block; @end @@ -47,7 +47,13 @@ static inline CGFloat LengthCGPoint(CGPoint point) @property (nonatomic) CGFloat height; @property (nonatomic) CGSize size; -+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay damping:(double)dampingRatio initialVelocity:(double)springVelocity options:(UIViewAnimationOptions)options animations:(TMWMVoidBlock)animations completion:(void (^)(BOOL finished))completion; ++ (void)animateWithDuration:(NSTimeInterval)duration + delay:(NSTimeInterval)delay + damping:(double)dampingRatio + initialVelocity:(double)springVelocity + options:(UIViewAnimationOptions)options + animations:(MWMVoidBlock)animations + completion:(void (^)(BOOL finished))completion; - (void)sizeToIntegralFit; @end diff --git a/iphone/Maps/Categories/UIKitCategories.mm b/iphone/Maps/Categories/UIKitCategories.mm index cb973c67bf..12c1e7c578 100644 --- a/iphone/Maps/Categories/UIKitCategories.mm +++ b/iphone/Maps/Categories/UIKitCategories.mm @@ -9,7 +9,7 @@ @implementation NSObject (Optimized) + (NSString *)className { return NSStringFromClass(self); } -- (void)performAfterDelay:(NSTimeInterval)delayInSec block:(TMWMVoidBlock)block +- (void)performAfterDelay:(NSTimeInterval)delayInSec block:(MWMVoidBlock)block { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSec * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ @@ -80,7 +80,7 @@ damping:(double)dampingRatio initialVelocity:(double)springVelocity options:(UIViewAnimationOptions)options - animations:(TMWMVoidBlock)animations + animations:(MWMVoidBlock)animations completion:(void (^)(BOOL))completion { [UIView animateWithDuration:duration diff --git a/iphone/Maps/Classes/Components/MWMAddPlaceNavigationBar.h b/iphone/Maps/Classes/Components/MWMAddPlaceNavigationBar.h index b3fc3166dc..9fc53f3730 100644 --- a/iphone/Maps/Classes/Components/MWMAddPlaceNavigationBar.h +++ b/iphone/Maps/Classes/Components/MWMAddPlaceNavigationBar.h @@ -2,8 +2,11 @@ @interface MWMAddPlaceNavigationBar : SolidTouchView -+ (void)showInSuperview:(UIView *)superview isBusiness:(BOOL)isBusiness - applyPosition:(BOOL)applyPosition position:(m2::PointD const &)position - doneBlock:(TMWMVoidBlock)done cancelBlock:(TMWMVoidBlock)cancel; ++ (void)showInSuperview:(UIView *)superview + isBusiness:(BOOL)isBusiness + applyPosition:(BOOL)applyPosition + position:(m2::PointD const &)position + doneBlock:(MWMVoidBlock)done + cancelBlock:(MWMVoidBlock)cancel; @end diff --git a/iphone/Maps/Classes/Components/MWMAddPlaceNavigationBar.mm b/iphone/Maps/Classes/Components/MWMAddPlaceNavigationBar.mm index 522779c432..f88de663f3 100644 --- a/iphone/Maps/Classes/Components/MWMAddPlaceNavigationBar.mm +++ b/iphone/Maps/Classes/Components/MWMAddPlaceNavigationBar.mm @@ -5,16 +5,19 @@ @interface MWMAddPlaceNavigationBar () -@property (copy, nonatomic) TMWMVoidBlock doneBlock; -@property (copy, nonatomic) TMWMVoidBlock cancelBlock; +@property(copy, nonatomic) MWMVoidBlock doneBlock; +@property(copy, nonatomic) MWMVoidBlock cancelBlock; @end @implementation MWMAddPlaceNavigationBar -+ (void)showInSuperview:(UIView *)superview isBusiness:(BOOL)isBusiness - applyPosition:(BOOL)applyPosition position:(m2::PointD const &)position - doneBlock:(TMWMVoidBlock)done cancelBlock:(TMWMVoidBlock)cancel ++ (void)showInSuperview:(UIView *)superview + isBusiness:(BOOL)isBusiness + applyPosition:(BOOL)applyPosition + position:(m2::PointD const &)position + doneBlock:(MWMVoidBlock)done + cancelBlock:(MWMVoidBlock)cancel { MWMAddPlaceNavigationBar * navBar = [[[NSBundle mainBundle] loadNibNamed:self.className owner:nil options:nil] firstObject]; navBar.width = superview.width; @@ -39,7 +42,7 @@ }]; } -- (void)dismissWithBlock:(TMWMVoidBlock)block +- (void)dismissWithBlock:(MWMVoidBlock)block { auto & f = GetFramework(); f.EnableChoosePositionMode(false /* enable */, false /* enableBounds */, false /* applyPosition */, m2::PointD()); diff --git a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h index 5dcd096de9..ab350cb8f8 100644 --- a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h +++ b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h @@ -11,47 +11,47 @@ - (nonnull instancetype)initWithViewController:(nonnull UIViewController *)viewController; - (void)presentAlert:(routing::IRouter::ResultCode)type; -- (void)presentRoutingMigrationAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock; +- (void)presentRoutingMigrationAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock; - (void)presentDownloaderAlertWithCountries:(storage::TCountriesVec const &)countries code:(routing::IRouter::ResultCode)code - cancelBlock:(nonnull TMWMVoidBlock)cancelBlock - downloadBlock:(nonnull TMWMDownloadBlock)downloadBlock - downloadCompleteBlock:(nonnull TMWMVoidBlock)downloadCompleteBlock; + cancelBlock:(nonnull MWMVoidBlock)cancelBlock + downloadBlock:(nonnull MWMDownloadBlock)downloadBlock + downloadCompleteBlock:(nonnull MWMVoidBlock)downloadCompleteBlock; - (void)presentRateAlert; - (void)presentFacebookAlert; -- (void)presentPoint2PointAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock +- (void)presentPoint2PointAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild; -- (void)presentRoutingDisclaimerAlertWithOkBlock:(nonnull nonnull TMWMVoidBlock)block; +- (void)presentRoutingDisclaimerAlertWithOkBlock:(nonnull nonnull MWMVoidBlock)block; - (void)presentDisabledLocationAlert; - (void)presentLocationAlert; - (void)presentLocationServiceNotSupportedAlert; -- (void)presentLocationNotFoundAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock; +- (void)presentLocationNotFoundAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock; - (void)presentNoConnectionAlert; - (void)presentMigrationProhibitedAlert; - (void)presentDeleteMapProhibitedAlert; -- (void)presentUnsavedEditsAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock; -- (void)presentNoWiFiAlertWithOkBlock:(nullable TMWMVoidBlock)okBlock; +- (void)presentUnsavedEditsAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock; +- (void)presentNoWiFiAlertWithOkBlock:(nullable MWMVoidBlock)okBlock; - (void)presentIncorrectFeauturePositionAlert; - (void)presentInternalErrorAlert; - (void)presentNotEnoughSpaceAlert; - (void)presentInvalidUserNameOrPasswordAlert; -- (void)presentDisableAutoDownloadAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock; -- (void)presentDownloaderNoConnectionAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock - cancelBlock:(nonnull TMWMVoidBlock)cancelBlock; +- (void)presentDisableAutoDownloadAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock; +- (void)presentDownloaderNoConnectionAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock + cancelBlock:(nonnull MWMVoidBlock)cancelBlock; - (void)presentDownloaderNotEnoughSpaceAlert; -- (void)presentDownloaderInternalErrorAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock - cancelBlock:(nonnull TMWMVoidBlock)cancelBlock; -- (void)presentDownloaderNeedUpdateAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock; +- (void)presentDownloaderInternalErrorAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock + cancelBlock:(nonnull MWMVoidBlock)cancelBlock; +- (void)presentDownloaderNeedUpdateAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock; - (void)presentPlaceDoesntExistAlertWithBlock:(nonnull MWMStringBlock)block; -- (void)presentResetChangesAlertWithBlock:(nonnull TMWMVoidBlock)block; -- (void)presentDeleteFeatureAlertWithBlock:(nonnull TMWMVoidBlock)block; +- (void)presentResetChangesAlertWithBlock:(nonnull MWMVoidBlock)block; +- (void)presentDeleteFeatureAlertWithBlock:(nonnull MWMVoidBlock)block; - (void)presentEditorViralAlert; - (void)presentOsmAuthAlert; -- (void)presentPersonalInfoWarningAlertWithBlock:(nonnull TMWMVoidBlock)block; -- (void)presentTrackWarningAlertWithCancelBlock:(nonnull TMWMVoidBlock)block; +- (void)presentPersonalInfoWarningAlertWithBlock:(nonnull MWMVoidBlock)block; +- (void)presentTrackWarningAlertWithCancelBlock:(nonnull MWMVoidBlock)block; - (void)presentSearchNoResultsAlert; -- (void)presentMobileInternetAlertWithBlock:(nonnull TMWMVoidBlock)block; -- (void)closeAlert:(nullable TMWMVoidBlock)completion; +- (void)presentMobileInternetAlertWithBlock:(nonnull MWMVoidBlock)block; +- (void)closeAlert:(nullable MWMVoidBlock)completion; - (nonnull instancetype)init __attribute__((unavailable("call -initWithViewController: instead!"))); + (nonnull instancetype) new __attribute__((unavailable("call -initWithViewController: instead!"))); diff --git a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm index b9ba151e73..3562d9ed9b 100644 --- a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm +++ b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm @@ -55,7 +55,7 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController if (![MapViewController controller].welcomePageController) [self displayAlert:[MWMAlert locationAlert]]; } -- (void)presentPoint2PointAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock +- (void)presentPoint2PointAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild { [self displayAlert:[MWMAlert point2PointAlertWithOkBlock:okBlock needToRebuild:needToRebuild]]; @@ -67,7 +67,7 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController [self displayAlert:MWMAlert.locationServiceNotSupportedAlert]; } -- (void)presentLocationNotFoundAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock +- (void)presentLocationNotFoundAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock { [self displayAlert:[MWMLocationNotFoundAlert alertWithOkBlock:okBlock]]; } @@ -75,12 +75,12 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController - (void)presentNoConnectionAlert { [self displayAlert:[MWMAlert noConnectionAlert]]; } - (void)presentMigrationProhibitedAlert { [self displayAlert:[MWMAlert migrationProhibitedAlert]]; } - (void)presentDeleteMapProhibitedAlert { [self displayAlert:[MWMAlert deleteMapProhibitedAlert]]; } -- (void)presentUnsavedEditsAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock +- (void)presentUnsavedEditsAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock { [self displayAlert:[MWMAlert unsavedEditsAlertWithOkBlock:okBlock]]; } -- (void)presentNoWiFiAlertWithOkBlock:(nullable TMWMVoidBlock)okBlock +- (void)presentNoWiFiAlertWithOkBlock:(nullable MWMVoidBlock)okBlock { [self displayAlert:[MWMAlert noWiFiAlertWithOkBlock:okBlock]]; } @@ -97,16 +97,16 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController [self displayAlert:[MWMAlert invalidUserNameOrPasswordAlert]]; } -- (void)presentRoutingMigrationAlertWithOkBlock:(TMWMVoidBlock)okBlock +- (void)presentRoutingMigrationAlertWithOkBlock:(MWMVoidBlock)okBlock { [self displayAlert:[MWMAlert routingMigrationAlertWithOkBlock:okBlock]]; } - (void)presentDownloaderAlertWithCountries:(storage::TCountriesVec const &)countries code:(routing::IRouter::ResultCode)code - cancelBlock:(TMWMVoidBlock)cancelBlock - downloadBlock:(TMWMDownloadBlock)downloadBlock - downloadCompleteBlock:(TMWMVoidBlock)downloadCompleteBlock + cancelBlock:(MWMVoidBlock)cancelBlock + downloadBlock:(MWMDownloadBlock)downloadBlock + downloadCompleteBlock:(MWMVoidBlock)downloadCompleteBlock { [self displayAlert:[MWMAlert downloaderAlertWithAbsentCountries:countries code:code @@ -115,7 +115,7 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController downloadCompleteBlock:downloadCompleteBlock]]; } -- (void)presentRoutingDisclaimerAlertWithOkBlock:(TMWMVoidBlock)block +- (void)presentRoutingDisclaimerAlertWithOkBlock:(MWMVoidBlock)block { [self displayAlert:[MWMAlert routingDisclaimerAlertWithOkBlock:block]]; } @@ -126,13 +126,13 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController [self displayAlert:[MWMAlert alert:type]]; } -- (void)presentDisableAutoDownloadAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock +- (void)presentDisableAutoDownloadAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock { [self displayAlert:[MWMAlert disableAutoDownloadAlertWithOkBlock:okBlock]]; } -- (void)presentDownloaderNoConnectionAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock - cancelBlock:(nonnull TMWMVoidBlock)cancelBlock +- (void)presentDownloaderNoConnectionAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock + cancelBlock:(nonnull MWMVoidBlock)cancelBlock { [self displayAlert:[MWMAlert downloaderNoConnectionAlertWithOkBlock:okBlock cancelBlock:cancelBlock]]; @@ -143,14 +143,14 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController [self displayAlert:[MWMAlert downloaderNotEnoughSpaceAlert]]; } -- (void)presentDownloaderInternalErrorAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock - cancelBlock:(nonnull TMWMVoidBlock)cancelBlock +- (void)presentDownloaderInternalErrorAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock + cancelBlock:(nonnull MWMVoidBlock)cancelBlock { [self displayAlert:[MWMAlert downloaderInternalErrorAlertWithOkBlock:okBlock cancelBlock:cancelBlock]]; } -- (void)presentDownloaderNeedUpdateAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock +- (void)presentDownloaderNeedUpdateAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock { [self displayAlert:[MWMAlert downloaderNeedUpdateAlertWithOkBlock:okBlock]]; } @@ -160,22 +160,22 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController [self displayAlert:[MWMAlert placeDoesntExistAlertWithBlock:block]]; } -- (void)presentResetChangesAlertWithBlock:(TMWMVoidBlock)block +- (void)presentResetChangesAlertWithBlock:(MWMVoidBlock)block { [self displayAlert:[MWMAlert resetChangesAlertWithBlock:block]]; } -- (void)presentDeleteFeatureAlertWithBlock:(TMWMVoidBlock)block +- (void)presentDeleteFeatureAlertWithBlock:(MWMVoidBlock)block { [self displayAlert:[MWMAlert deleteFeatureAlertWithBlock:block]]; } -- (void)presentPersonalInfoWarningAlertWithBlock:(nonnull TMWMVoidBlock)block +- (void)presentPersonalInfoWarningAlertWithBlock:(nonnull MWMVoidBlock)block { [self displayAlert:[MWMAlert personalInfoWarningAlertWithBlock:block]]; } -- (void)presentTrackWarningAlertWithCancelBlock:(nonnull TMWMVoidBlock)block +- (void)presentTrackWarningAlertWithCancelBlock:(nonnull MWMVoidBlock)block { [self displayAlert:[MWMAlert trackWarningAlertWithCancelBlock:block]]; } @@ -202,7 +202,7 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController [alert update]; } -- (void)presentMobileInternetAlertWithBlock:(nonnull TMWMVoidBlock)block +- (void)presentMobileInternetAlertWithBlock:(nonnull MWMVoidBlock)block { [self displayAlert:[MWMMobileInternetAlert alertWithBlock:block]]; } @@ -247,7 +247,7 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController [MapsAppDelegate.theApp.window endEditing:YES]; } -- (void)closeAlert:(nullable TMWMVoidBlock)completion +- (void)closeAlert:(nullable MWMVoidBlock)completion { NSArray * subviews = self.view.subviews; MWMAlert * closeAlert = subviews.lastObject; diff --git a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h index baf9eedab6..cb90b11bb7 100644 --- a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h +++ b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h @@ -1,7 +1,7 @@ #include "routing/router.hpp" #include "storage/storage.hpp" -using TMWMDownloadBlock = void (^)(storage::TCountriesVec const &, TMWMVoidBlock); +using MWMDownloadBlock = void (^)(storage::TCountriesVec const &, MWMVoidBlock); @class MWMAlertViewController; @interface MWMAlert : UIView @@ -9,43 +9,43 @@ using TMWMDownloadBlock = void (^)(storage::TCountriesVec const &, TMWMVoidBlock @property(weak, nonatomic) MWMAlertViewController * alertController; + (MWMAlert *)alert:(routing::IRouter::ResultCode)type; -+ (MWMAlert *)routingMigrationAlertWithOkBlock:(TMWMVoidBlock)okBlock; ++ (MWMAlert *)routingMigrationAlertWithOkBlock:(MWMVoidBlock)okBlock; + (MWMAlert *)downloaderAlertWithAbsentCountries:(storage::TCountriesVec const &)countries code:(routing::IRouter::ResultCode)code - cancelBlock:(TMWMVoidBlock)cancelBlock - downloadBlock:(TMWMDownloadBlock)downloadBlock - downloadCompleteBlock:(TMWMVoidBlock)downloadCompleteBlock; + cancelBlock:(MWMVoidBlock)cancelBlock + downloadBlock:(MWMDownloadBlock)downloadBlock + downloadCompleteBlock:(MWMVoidBlock)downloadCompleteBlock; + (MWMAlert *)rateAlert; + (MWMAlert *)facebookAlert; + (MWMAlert *)locationAlert; -+ (MWMAlert *)routingDisclaimerAlertWithOkBlock:(TMWMVoidBlock)block; ++ (MWMAlert *)routingDisclaimerAlertWithOkBlock:(MWMVoidBlock)block; + (MWMAlert *)disabledLocationAlert; -+ (MWMAlert *)noWiFiAlertWithOkBlock:(TMWMVoidBlock)okBlock; ++ (MWMAlert *)noWiFiAlertWithOkBlock:(MWMVoidBlock)okBlock; + (MWMAlert *)noConnectionAlert; + (MWMAlert *)migrationProhibitedAlert; + (MWMAlert *)deleteMapProhibitedAlert; -+ (MWMAlert *)unsavedEditsAlertWithOkBlock:(TMWMVoidBlock)okBlock; ++ (MWMAlert *)unsavedEditsAlertWithOkBlock:(MWMVoidBlock)okBlock; + (MWMAlert *)locationServiceNotSupportedAlert; + (MWMAlert *)incorrectFeauturePositionAlert; + (MWMAlert *)internalErrorAlert; + (MWMAlert *)notEnoughSpaceAlert; + (MWMAlert *)invalidUserNameOrPasswordAlert; -+ (MWMAlert *)point2PointAlertWithOkBlock:(TMWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild; -+ (MWMAlert *)disableAutoDownloadAlertWithOkBlock:(TMWMVoidBlock)okBlock; -+ (MWMAlert *)downloaderNoConnectionAlertWithOkBlock:(TMWMVoidBlock)okBlock - cancelBlock:(TMWMVoidBlock)cancelBlock; ++ (MWMAlert *)point2PointAlertWithOkBlock:(MWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild; ++ (MWMAlert *)disableAutoDownloadAlertWithOkBlock:(MWMVoidBlock)okBlock; ++ (MWMAlert *)downloaderNoConnectionAlertWithOkBlock:(MWMVoidBlock)okBlock + cancelBlock:(MWMVoidBlock)cancelBlock; + (MWMAlert *)downloaderNotEnoughSpaceAlert; -+ (MWMAlert *)downloaderInternalErrorAlertWithOkBlock:(TMWMVoidBlock)okBlock - cancelBlock:(TMWMVoidBlock)cancelBlock; -+ (MWMAlert *)downloaderNeedUpdateAlertWithOkBlock:(TMWMVoidBlock)okBlock; ++ (MWMAlert *)downloaderInternalErrorAlertWithOkBlock:(MWMVoidBlock)okBlock + cancelBlock:(MWMVoidBlock)cancelBlock; ++ (MWMAlert *)downloaderNeedUpdateAlertWithOkBlock:(MWMVoidBlock)okBlock; + (MWMAlert *)placeDoesntExistAlertWithBlock:(MWMStringBlock)block; -+ (MWMAlert *)resetChangesAlertWithBlock:(TMWMVoidBlock)block; -+ (MWMAlert *)deleteFeatureAlertWithBlock:(TMWMVoidBlock)block; ++ (MWMAlert *)resetChangesAlertWithBlock:(MWMVoidBlock)block; ++ (MWMAlert *)deleteFeatureAlertWithBlock:(MWMVoidBlock)block; + (MWMAlert *)editorViralAlert; + (MWMAlert *)osmAuthAlert; -+ (MWMAlert *)personalInfoWarningAlertWithBlock:(TMWMVoidBlock)block; -+ (MWMAlert *)trackWarningAlertWithCancelBlock:(TMWMVoidBlock)block; -- (void)close:(TMWMVoidBlock)completion; ++ (MWMAlert *)personalInfoWarningAlertWithBlock:(MWMVoidBlock)block; ++ (MWMAlert *)trackWarningAlertWithCancelBlock:(MWMVoidBlock)block; +- (void)close:(MWMVoidBlock)completion; - (void)setNeedsCloseAlertAfterEnterBackground; - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation; diff --git a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm index 342f4ec2bf..bc8fa0ca3a 100644 --- a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm @@ -16,18 +16,18 @@ + (MWMAlert *)rateAlert { return [MWMRateAlert alert]; } + (MWMAlert *)locationAlert { return [MWMLocationAlert alert]; } + (MWMAlert *)facebookAlert { return [MWMFacebookAlert alert]; } -+ (MWMAlert *)point2PointAlertWithOkBlock:(TMWMVoidBlock)block needToRebuild:(BOOL)needToRebuild ++ (MWMAlert *)point2PointAlertWithOkBlock:(MWMVoidBlock)block needToRebuild:(BOOL)needToRebuild { return [MWMDefaultAlert point2PointAlertWithOkBlock:block needToRebuild:needToRebuild]; } -+ (MWMAlert *)routingDisclaimerAlertWithOkBlock:(TMWMVoidBlock)block ++ (MWMAlert *)routingDisclaimerAlertWithOkBlock:(MWMVoidBlock)block { return [MWMRoutingDisclaimerAlert alertWithOkBlock:block]; } + (MWMAlert *)disabledLocationAlert { return [MWMDefaultAlert disabledLocationAlert]; } -+ (MWMAlert *)noWiFiAlertWithOkBlock:(TMWMVoidBlock)okBlock ++ (MWMAlert *)noWiFiAlertWithOkBlock:(MWMVoidBlock)okBlock { return [MWMDefaultAlert noWiFiAlertWithOkBlock:okBlock]; } @@ -35,7 +35,7 @@ + (MWMAlert *)noConnectionAlert { return [MWMDefaultAlert noConnectionAlert]; } + (MWMAlert *)migrationProhibitedAlert { return [MWMDefaultAlert migrationProhibitedAlert]; } + (MWMAlert *)deleteMapProhibitedAlert { return [MWMDefaultAlert deleteMapProhibitedAlert]; } -+ (MWMAlert *)unsavedEditsAlertWithOkBlock:(TMWMVoidBlock)okBlock ++ (MWMAlert *)unsavedEditsAlertWithOkBlock:(MWMVoidBlock)okBlock { return [MWMDefaultAlert unsavedEditsAlertWithOkBlock:okBlock]; } @@ -45,16 +45,16 @@ return [MWMDefaultAlert locationServiceNotSupportedAlert]; } -+ (MWMAlert *)routingMigrationAlertWithOkBlock:(TMWMVoidBlock)okBlock ++ (MWMAlert *)routingMigrationAlertWithOkBlock:(MWMVoidBlock)okBlock { return [MWMDefaultAlert routingMigrationAlertWithOkBlock:okBlock]; } + (MWMAlert *)downloaderAlertWithAbsentCountries:(storage::TCountriesVec const &)countries code:(routing::IRouter::ResultCode)code - cancelBlock:(TMWMVoidBlock)cancelBlock - downloadBlock:(TMWMDownloadBlock)downloadBlock - downloadCompleteBlock:(TMWMVoidBlock)downloadCompleteBlock + cancelBlock:(MWMVoidBlock)cancelBlock + downloadBlock:(MWMDownloadBlock)downloadBlock + downloadCompleteBlock:(MWMVoidBlock)downloadCompleteBlock { return [MWMDownloadTransitMapAlert downloaderAlertWithMaps:countries code:code @@ -94,13 +94,13 @@ return [MWMDefaultAlert invalidUserNameOrPasswordAlert]; } -+ (MWMAlert *)disableAutoDownloadAlertWithOkBlock:(TMWMVoidBlock)okBlock ++ (MWMAlert *)disableAutoDownloadAlertWithOkBlock:(MWMVoidBlock)okBlock { return [MWMDefaultAlert disableAutoDownloadAlertWithOkBlock:okBlock]; } -+ (MWMAlert *)downloaderNoConnectionAlertWithOkBlock:(TMWMVoidBlock)okBlock - cancelBlock:(TMWMVoidBlock)cancelBlock ++ (MWMAlert *)downloaderNoConnectionAlertWithOkBlock:(MWMVoidBlock)okBlock + cancelBlock:(MWMVoidBlock)cancelBlock { return [MWMDefaultAlert downloaderNoConnectionAlertWithOkBlock:okBlock cancelBlock:cancelBlock]; } @@ -110,13 +110,13 @@ return [MWMDefaultAlert downloaderNotEnoughSpaceAlert]; } -+ (MWMAlert *)downloaderInternalErrorAlertWithOkBlock:(TMWMVoidBlock)okBlock - cancelBlock:(TMWMVoidBlock)cancelBlock ++ (MWMAlert *)downloaderInternalErrorAlertWithOkBlock:(MWMVoidBlock)okBlock + cancelBlock:(MWMVoidBlock)cancelBlock { return [MWMDefaultAlert downloaderInternalErrorAlertWithOkBlock:okBlock cancelBlock:cancelBlock]; } -+ (MWMAlert *)downloaderNeedUpdateAlertWithOkBlock:(TMWMVoidBlock)okBlock ++ (MWMAlert *)downloaderNeedUpdateAlertWithOkBlock:(MWMVoidBlock)okBlock { return [MWMDefaultAlert downloaderNeedUpdateAlertWithOkBlock:okBlock]; } @@ -126,24 +126,24 @@ return [MWMPlaceDoesntExistAlert alertWithBlock:block]; } -+ (MWMAlert *)resetChangesAlertWithBlock:(TMWMVoidBlock)block ++ (MWMAlert *)resetChangesAlertWithBlock:(MWMVoidBlock)block { return [MWMDefaultAlert resetChangesAlertWithBlock:block]; } -+ (MWMAlert *)deleteFeatureAlertWithBlock:(TMWMVoidBlock)block ++ (MWMAlert *)deleteFeatureAlertWithBlock:(MWMVoidBlock)block { return [MWMDefaultAlert deleteFeatureAlertWithBlock:block]; } + (MWMAlert *)editorViralAlert { return [MWMEditorViralAlert alert]; } + (MWMAlert *)osmAuthAlert { return [MWMOsmAuthAlert alert]; } -+ (MWMAlert *)personalInfoWarningAlertWithBlock:(TMWMVoidBlock)block ++ (MWMAlert *)personalInfoWarningAlertWithBlock:(MWMVoidBlock)block { return [MWMDefaultAlert personalInfoWarningAlertWithBlock:block]; } -+ (MWMAlert *)trackWarningAlertWithCancelBlock:(TMWMVoidBlock)block ++ (MWMAlert *)trackWarningAlertWithCancelBlock:(MWMVoidBlock)block { return [MWMDefaultAlert trackWarningAlertWithCancelBlock:block]; } @@ -153,7 +153,7 @@ // Should override this method if you want custom relayout after rotation. } -- (void)close:(TMWMVoidBlock)completion { [self.alertController closeAlert:completion]; } +- (void)close:(MWMVoidBlock)completion { [self.alertController closeAlert:completion]; } - (void)setNeedsCloseAlertAfterEnterBackground { [[NSNotificationCenter defaultCenter] addObserver:self diff --git a/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.h b/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.h index 6ecea8d66b..b75c37532d 100644 --- a/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.h +++ b/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.h @@ -14,22 +14,24 @@ + (instancetype)noCurrentPositionAlert; + (instancetype)pointsInDifferentMWMAlert; + (instancetype)disabledLocationAlert; -+ (instancetype)noWiFiAlertWithOkBlock:(TMWMVoidBlock)okBlock; ++ (instancetype)noWiFiAlertWithOkBlock:(MWMVoidBlock)okBlock; + (instancetype)noConnectionAlert; + (instancetype)migrationProhibitedAlert; + (instancetype)deleteMapProhibitedAlert; -+ (instancetype)unsavedEditsAlertWithOkBlock:(TMWMVoidBlock)okBlock; ++ (instancetype)unsavedEditsAlertWithOkBlock:(MWMVoidBlock)okBlock; + (instancetype)locationServiceNotSupportedAlert; -+ (instancetype)point2PointAlertWithOkBlock:(TMWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild; -+ (instancetype)disableAutoDownloadAlertWithOkBlock:(TMWMVoidBlock)okBlock; -+ (instancetype)downloaderNoConnectionAlertWithOkBlock:(TMWMVoidBlock)okBlock cancelBlock:(TMWMVoidBlock)cancelBlock; ++ (instancetype)point2PointAlertWithOkBlock:(MWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild; ++ (instancetype)disableAutoDownloadAlertWithOkBlock:(MWMVoidBlock)okBlock; ++ (instancetype)downloaderNoConnectionAlertWithOkBlock:(MWMVoidBlock)okBlock + cancelBlock:(MWMVoidBlock)cancelBlock; + (instancetype)downloaderNotEnoughSpaceAlert; -+ (instancetype)downloaderInternalErrorAlertWithOkBlock:(TMWMVoidBlock)okBlock cancelBlock:(TMWMVoidBlock)cancelBlock; -+ (instancetype)downloaderNeedUpdateAlertWithOkBlock:(TMWMVoidBlock)okBlock; -+ (instancetype)routingMigrationAlertWithOkBlock:(TMWMVoidBlock)okBlock; -+ (instancetype)resetChangesAlertWithBlock:(TMWMVoidBlock)block; -+ (instancetype)deleteFeatureAlertWithBlock:(TMWMVoidBlock)block; -+ (instancetype)personalInfoWarningAlertWithBlock:(TMWMVoidBlock)block; -+ (instancetype)trackWarningAlertWithCancelBlock:(TMWMVoidBlock)block; ++ (instancetype)downloaderInternalErrorAlertWithOkBlock:(MWMVoidBlock)okBlock + cancelBlock:(MWMVoidBlock)cancelBlock; ++ (instancetype)downloaderNeedUpdateAlertWithOkBlock:(MWMVoidBlock)okBlock; ++ (instancetype)routingMigrationAlertWithOkBlock:(MWMVoidBlock)okBlock; ++ (instancetype)resetChangesAlertWithBlock:(MWMVoidBlock)block; ++ (instancetype)deleteFeatureAlertWithBlock:(MWMVoidBlock)block; ++ (instancetype)personalInfoWarningAlertWithBlock:(MWMVoidBlock)block; ++ (instancetype)trackWarningAlertWithCancelBlock:(MWMVoidBlock)block; @end diff --git a/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm b/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm index d193527456..98d2e1bf54 100644 --- a/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert.mm @@ -18,8 +18,8 @@ static CGFloat const kDividerTopConstant = -8.; @property(weak, nonatomic) IBOutlet UIButton * leftButton; @property(weak, nonatomic) IBOutlet UILabel * titleLabel; @property(weak, nonatomic) IBOutlet NSLayoutConstraint * rightButtonWidth; -@property(copy, nonatomic) TMWMVoidBlock leftButtonAction; -@property(copy, nonatomic, readwrite) TMWMVoidBlock rightButtonAction; +@property(copy, nonatomic) MWMVoidBlock leftButtonAction; +@property(copy, nonatomic, readwrite) MWMVoidBlock rightButtonAction; @property(weak, nonatomic) IBOutlet NSLayoutConstraint * dividerTop; @property(copy, nonatomic) NSString * statisticsEvent; @@ -98,7 +98,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; return alert; } -+ (instancetype)unsavedEditsAlertWithOkBlock:(TMWMVoidBlock)okBlock ++ (instancetype)unsavedEditsAlertWithOkBlock:(MWMVoidBlock)okBlock { return [self defaultAlertWithTitle:L(@"please_note") message:L(@"downloader_delete_map_dialog") @@ -108,7 +108,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; statisticsEvent:@"Editor unsaved changes on delete"]; } -+ (instancetype)noWiFiAlertWithOkBlock:(TMWMVoidBlock)okBlock ++ (instancetype)noWiFiAlertWithOkBlock:(MWMVoidBlock)okBlock { MWMDefaultAlert * alert = [self defaultAlertWithTitle:L(@"download_over_mobile_header") message:L(@"download_over_mobile_message") @@ -216,7 +216,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; + (instancetype)disabledLocationAlert { - TMWMVoidBlock action = ^{ + MWMVoidBlock action = ^{ GetFramework().SwitchMyPositionNextMode(); }; return [self defaultAlertWithTitle:L(@"dialog_routing_location_turn_on") @@ -237,7 +237,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; statisticsEvent:@"Points In Different MWM Alert"]; } -+ (instancetype)point2PointAlertWithOkBlock:(TMWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild ++ (instancetype)point2PointAlertWithOkBlock:(MWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild { if (needToRebuild) { @@ -259,7 +259,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; } } -+ (instancetype)disableAutoDownloadAlertWithOkBlock:(TMWMVoidBlock)okBlock ++ (instancetype)disableAutoDownloadAlertWithOkBlock:(MWMVoidBlock)okBlock { MWMDefaultAlert * alert = [self defaultAlertWithTitle:L(@"disable_auto_download") message:nil @@ -271,7 +271,8 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; return alert; } -+ (instancetype)downloaderNoConnectionAlertWithOkBlock:(TMWMVoidBlock)okBlock cancelBlock:(TMWMVoidBlock)cancelBlock ++ (instancetype)downloaderNoConnectionAlertWithOkBlock:(MWMVoidBlock)okBlock + cancelBlock:(MWMVoidBlock)cancelBlock { MWMDefaultAlert * alert = [self defaultAlertWithTitle:L(@"downloader_status_failed") @@ -297,7 +298,8 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; return alert; } -+ (instancetype)downloaderInternalErrorAlertWithOkBlock:(TMWMVoidBlock)okBlock cancelBlock:(TMWMVoidBlock)cancelBlock ++ (instancetype)downloaderInternalErrorAlertWithOkBlock:(MWMVoidBlock)okBlock + cancelBlock:(MWMVoidBlock)cancelBlock { MWMDefaultAlert * alert = [self defaultAlertWithTitle:L(@"migration_download_error_dialog") message:nil @@ -310,7 +312,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; return alert; } -+ (instancetype)downloaderNeedUpdateAlertWithOkBlock:(TMWMVoidBlock)okBlock ++ (instancetype)downloaderNeedUpdateAlertWithOkBlock:(MWMVoidBlock)okBlock { MWMDefaultAlert * alert = [self defaultAlertWithTitle:L(@"downloader_need_update_title") message:L(@"downloader_need_update_message") @@ -322,7 +324,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; return alert; } -+ (instancetype)routingMigrationAlertWithOkBlock:(TMWMVoidBlock)okBlock ++ (instancetype)routingMigrationAlertWithOkBlock:(MWMVoidBlock)okBlock { MWMDefaultAlert * alert = [self defaultAlertWithTitle:L(@"downloader_update_maps") message:L(@"downloader_mwm_migration_dialog") @@ -333,7 +335,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; return alert; } -+ (instancetype)resetChangesAlertWithBlock:(TMWMVoidBlock)block ++ (instancetype)resetChangesAlertWithBlock:(MWMVoidBlock)block { MWMDefaultAlert * alert = [self defaultAlertWithTitle:L(@"editor_reset_edits_message") message:nil @@ -344,7 +346,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; return alert; } -+ (instancetype)deleteFeatureAlertWithBlock:(TMWMVoidBlock)block ++ (instancetype)deleteFeatureAlertWithBlock:(MWMVoidBlock)block { MWMDefaultAlert * alert = [self defaultAlertWithTitle:L(@"editor_remove_place_message") message:nil @@ -355,7 +357,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; return alert; } -+ (instancetype)personalInfoWarningAlertWithBlock:(TMWMVoidBlock)block ++ (instancetype)personalInfoWarningAlertWithBlock:(MWMVoidBlock)block { NSString * message = [NSString stringWithFormat:@"%@\n%@", L(@"editor_share_to_all_dialog_message_1"), L(@"editor_share_to_all_dialog_message_2")]; MWMDefaultAlert * alert = [self defaultAlertWithTitle:L(@"editor_share_to_all_dialog_title") @@ -367,7 +369,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; return alert; } -+ (instancetype)trackWarningAlertWithCancelBlock:(TMWMVoidBlock)block ++ (instancetype)trackWarningAlertWithCancelBlock:(MWMVoidBlock)block { MWMDefaultAlert * alert = [self defaultAlertWithTitle:L(@"recent_track_background_dialog_title") message:L(@"recent_track_background_dialog_message") @@ -382,7 +384,7 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert"; message:(nullable NSString *)message rightButtonTitle:(nonnull NSString *)rightButtonTitle leftButtonTitle:(nullable NSString *)leftButtonTitle - rightButtonAction:(nullable TMWMVoidBlock)action + rightButtonAction:(nullable MWMVoidBlock)action statisticsEvent:(nonnull NSString *)statisticsEvent { [Statistics logEvent:statisticsEvent withParameters:@{kStatAction : kStatOpen}]; diff --git a/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert_Protected.h b/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert_Protected.h index a6585fe7a6..54f18d745f 100644 --- a/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert_Protected.h +++ b/iphone/Maps/Classes/CustomAlert/DefaultAlert/MWMDefaultAlert_Protected.h @@ -6,9 +6,9 @@ message:(nullable NSString *)message rightButtonTitle:(nonnull NSString *)rightButtonTitle leftButtonTitle:(nullable NSString *)leftButtonTitle - rightButtonAction:(nullable TMWMVoidBlock)action + rightButtonAction:(nullable MWMVoidBlock)action statisticsEvent:(nonnull NSString *)statisticsEvent; -@property(copy, nonatomic, readonly, nullable) TMWMVoidBlock rightButtonAction; +@property(copy, nonatomic, readonly, nullable) MWMVoidBlock rightButtonAction; @end diff --git a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.h b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.h index 25a8b9b773..ab3047ac78 100644 --- a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.h +++ b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.h @@ -6,9 +6,9 @@ + (instancetype)downloaderAlertWithMaps:(storage::TCountriesVec const &)countries code:(routing::IRouter::ResultCode)code - cancelBlock:(TMWMVoidBlock)cancelBlock - downloadBlock:(TMWMDownloadBlock)downloadBlock - downloadCompleteBlock:(TMWMVoidBlock)downloadCompleteBlock; + cancelBlock:(MWMVoidBlock)cancelBlock + downloadBlock:(MWMDownloadBlock)downloadBlock + downloadCompleteBlock:(MWMVoidBlock)downloadCompleteBlock; - (void)showDownloadDetail:(UIButton *)sender; @end diff --git a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm index 4f11152439..1cb32be2fd 100644 --- a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm @@ -25,9 +25,9 @@ CGFloat const kAnimationDuration = .05; @interface MWMDownloadTransitMapAlert () -@property (copy, nonatomic) TMWMVoidBlock cancelBlock; -@property (copy, nonatomic) TMWMDownloadBlock downloadBlock; -@property (copy, nonatomic) TMWMVoidBlock downloadCompleteBlock; +@property(copy, nonatomic) MWMVoidBlock cancelBlock; +@property(copy, nonatomic) MWMDownloadBlock downloadBlock; +@property(copy, nonatomic) MWMVoidBlock downloadCompleteBlock; @property (nonatomic) MWMCircularProgress * progress; @@ -59,9 +59,9 @@ CGFloat const kAnimationDuration = .05; + (instancetype)downloaderAlertWithMaps:(storage::TCountriesVec const &)countries code:(routing::IRouter::ResultCode)code - cancelBlock:(TMWMVoidBlock)cancelBlock - downloadBlock:(TMWMDownloadBlock)downloadBlock - downloadCompleteBlock:(TMWMVoidBlock)downloadCompleteBlock + cancelBlock:(MWMVoidBlock)cancelBlock + downloadBlock:(MWMDownloadBlock)downloadBlock + downloadCompleteBlock:(MWMVoidBlock)downloadCompleteBlock { [Statistics logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatOpen}]; MWMDownloadTransitMapAlert * alert = [self alertWithCountries:countries]; @@ -285,7 +285,7 @@ CGFloat const kAnimationDuration = .05; [self invalidateTableConstraintWithHeight:height]; } -- (void)close:(TMWMVoidBlock)completion +- (void)close:(MWMVoidBlock)completion { [MWMFrameworkListener removeObserver:self]; [super close:completion]; diff --git a/iphone/Maps/Classes/CustomAlert/LocationNotFoundAlert/MWMLocationNotFoundAlert.h b/iphone/Maps/Classes/CustomAlert/LocationNotFoundAlert/MWMLocationNotFoundAlert.h index a5fee66ccc..ed69969a52 100644 --- a/iphone/Maps/Classes/CustomAlert/LocationNotFoundAlert/MWMLocationNotFoundAlert.h +++ b/iphone/Maps/Classes/CustomAlert/LocationNotFoundAlert/MWMLocationNotFoundAlert.h @@ -2,6 +2,6 @@ @interface MWMLocationNotFoundAlert : MWMDefaultAlert -+ (instancetype)alertWithOkBlock:(TMWMVoidBlock)okBlock; ++ (instancetype)alertWithOkBlock:(MWMVoidBlock)okBlock; @end diff --git a/iphone/Maps/Classes/CustomAlert/LocationNotFoundAlert/MWMLocationNotFoundAlert.mm b/iphone/Maps/Classes/CustomAlert/LocationNotFoundAlert/MWMLocationNotFoundAlert.mm index 4ff8b8eaf5..75d6df6b56 100644 --- a/iphone/Maps/Classes/CustomAlert/LocationNotFoundAlert/MWMLocationNotFoundAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/LocationNotFoundAlert/MWMLocationNotFoundAlert.mm @@ -9,7 +9,7 @@ @implementation MWMLocationNotFoundAlert -+ (instancetype)alertWithOkBlock:(TMWMVoidBlock)okBlock ++ (instancetype)alertWithOkBlock:(MWMVoidBlock)okBlock { MWMLocationNotFoundAlert * alert = [self defaultAlertWithTitle:L(@"current_location_unknown_title") diff --git a/iphone/Maps/Classes/CustomAlert/MobileInternetAlert/MWMMobileInternetAlert.h b/iphone/Maps/Classes/CustomAlert/MobileInternetAlert/MWMMobileInternetAlert.h index 0f635e44f8..84634933a4 100644 --- a/iphone/Maps/Classes/CustomAlert/MobileInternetAlert/MWMMobileInternetAlert.h +++ b/iphone/Maps/Classes/CustomAlert/MobileInternetAlert/MWMMobileInternetAlert.h @@ -2,6 +2,6 @@ @interface MWMMobileInternetAlert : MWMAlert -+ (nonnull instancetype)alertWithBlock:(nonnull TMWMVoidBlock)block; ++ (nonnull instancetype)alertWithBlock:(nonnull MWMVoidBlock)block; @end diff --git a/iphone/Maps/Classes/CustomAlert/MobileInternetAlert/MWMMobileInternetAlert.mm b/iphone/Maps/Classes/CustomAlert/MobileInternetAlert/MWMMobileInternetAlert.mm index 037870d00c..954cbb7dd6 100644 --- a/iphone/Maps/Classes/CustomAlert/MobileInternetAlert/MWMMobileInternetAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/MobileInternetAlert/MWMMobileInternetAlert.mm @@ -12,13 +12,13 @@ NSString * const kStatisticsEvent = @"Mobile Internet Settings Alert"; @interface MWMMobileInternetAlert () -@property(copy, nonatomic) TMWMVoidBlock completionBlock; +@property(copy, nonatomic) MWMVoidBlock completionBlock; @end @implementation MWMMobileInternetAlert -+ (nonnull instancetype)alertWithBlock:(nonnull TMWMVoidBlock)block ++ (nonnull instancetype)alertWithBlock:(nonnull MWMVoidBlock)block { [Statistics logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatOpen}]; MWMMobileInternetAlert * alert = diff --git a/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.h b/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.h index db4282d404..2ec52c7307 100644 --- a/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.h +++ b/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.h @@ -2,6 +2,6 @@ @interface MWMRoutingDisclaimerAlert : MWMAlert -+ (instancetype)alertWithOkBlock:(TMWMVoidBlock)block; ++ (instancetype)alertWithOkBlock:(MWMVoidBlock)block; @end diff --git a/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.mm b/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.mm index 77c2ac1d6f..dd6c16fbf0 100644 --- a/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/RoutingDisclaimerAlert/MWMRoutingDisclaimerAlert.mm @@ -10,13 +10,13 @@ static NSString * const kStatisticsEvent = @"Routing Disclaimer Alert"; @property(weak, nonatomic) IBOutlet UITextView * textView; @property(weak, nonatomic) IBOutlet NSLayoutConstraint * textViewHeight; -@property(copy, nonatomic) TMWMVoidBlock okBlock; +@property(copy, nonatomic) MWMVoidBlock okBlock; @end @implementation MWMRoutingDisclaimerAlert -+ (instancetype)alertWithOkBlock:(TMWMVoidBlock)block ++ (instancetype)alertWithOkBlock:(MWMVoidBlock)block { [Statistics logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatOpen}]; MWMRoutingDisclaimerAlert * alert = diff --git a/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationLoginViewController.mm b/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationLoginViewController.mm index eb34aa41e2..9e0f711ea9 100644 --- a/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationLoginViewController.mm +++ b/iphone/Maps/Classes/CustomViews/Login/MWMAuthorizationLoginViewController.mm @@ -105,7 +105,7 @@ using namespace osm_auth_ios; #pragma mark - Actions -- (void)performOnlineAction:(TMWMVoidBlock)block +- (void)performOnlineAction:(MWMVoidBlock)block { if (Platform::IsConnected()) block(); diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.h b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.h index a6c54231f7..0157d64b68 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.h +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.h @@ -13,7 +13,7 @@ - (void)requestTaxiFrom:(MWMRoutePoint *)from to:(MWMRoutePoint *)to - completion:(TMWMVoidBlock)completion + completion:(MWMVoidBlock)completion failure:(MWMStringBlock)failure; - (NSURL *)taxiURL; diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.mm index 1c9b0b351f..7871166302 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.mm @@ -99,7 +99,7 @@ using namespace uber; - (void)requestTaxiFrom:(MWMRoutePoint *)from to:(MWMRoutePoint *)to - completion:(TMWMVoidBlock)completion + completion:(MWMVoidBlock)completion failure:(MWMStringBlock)failure { NSAssert(completion && failure, @"Completion and failure blocks must be not nil!"); diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index 6254e72303..c669862b59 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -404,7 +404,7 @@ using namespace osm_auth_ios; } }); }; - auto const runFetchTask = ^(TMWMVoidBlock task) { + auto const runFetchTask = ^(MWMVoidBlock task) { ++fetchRunningTasks; task(); }; diff --git a/iphone/Maps/Common/MWMTypes.h b/iphone/Maps/Common/MWMTypes.h index d8318933e6..d63ee2e7e3 100644 --- a/iphone/Maps/Common/MWMTypes.h +++ b/iphone/Maps/Common/MWMTypes.h @@ -1,4 +1,4 @@ -typedef void (^TMWMVoidBlock)(); +typedef void (^MWMVoidBlock)(); typedef void (^MWMStringBlock)(NSString *); typedef NS_ENUM(NSUInteger, MWMDayTime) { MWMDayTimeDay, MWMDayTimeNight }; diff --git a/iphone/Maps/Core/Routing/MWMRouter.mm b/iphone/Maps/Core/Routing/MWMRouter.mm index a3c59c9fb2..8d386b4bd4 100644 --- a/iphone/Maps/Core/Routing/MWMRouter.mm +++ b/iphone/Maps/Core/Routing/MWMRouter.mm @@ -437,7 +437,7 @@ bool isMarkerPoint(MWMRoutePoint * point) { return point.isValid && !point.isMyP if (code != routing::IRouter::NeedMoreMaps) [[[self class] router] stop]; } - downloadBlock:^(storage::TCountriesVec const & downloadCountries, TMWMVoidBlock onSuccess) { + downloadBlock:^(storage::TCountriesVec const & downloadCountries, MWMVoidBlock onSuccess) { [MWMStorage downloadNodes:downloadCountries onSuccess:onSuccess]; } diff --git a/iphone/Maps/Core/Storage/MWMStorage.h b/iphone/Maps/Core/Storage/MWMStorage.h index 5fd7cfd867..68363d414d 100644 --- a/iphone/Maps/Core/Storage/MWMStorage.h +++ b/iphone/Maps/Core/Storage/MWMStorage.h @@ -4,13 +4,13 @@ @interface MWMStorage : NSObject -+ (void)downloadNode:(storage::TCountryId const &)countryId onSuccess:(TMWMVoidBlock)onSuccess; ++ (void)downloadNode:(storage::TCountryId const &)countryId onSuccess:(MWMVoidBlock)onSuccess; + (void)retryDownloadNode:(storage::TCountryId const &)countryId; + (void)updateNode:(storage::TCountryId const &)countryId; + (void)deleteNode:(storage::TCountryId const &)countryId; + (void)cancelDownloadNode:(storage::TCountryId const &)countryId; + (void)showNode:(storage::TCountryId const &)countryId; -+ (void)downloadNodes:(storage::TCountriesVec const &)countryIds onSuccess:(TMWMVoidBlock)onSuccess; ++ (void)downloadNodes:(storage::TCountriesVec const &)countryIds onSuccess:(MWMVoidBlock)onSuccess; @end diff --git a/iphone/Maps/Core/Storage/MWMStorage.mm b/iphone/Maps/Core/Storage/MWMStorage.mm index 061e0192c3..fb3d2374dc 100644 --- a/iphone/Maps/Core/Storage/MWMStorage.mm +++ b/iphone/Maps/Core/Storage/MWMStorage.mm @@ -11,8 +11,7 @@ using namespace storage; @implementation MWMStorage -+ (void)downloadNode:(TCountryId const &)countryId - onSuccess:(TMWMVoidBlock)onSuccess ++ (void)downloadNode:(TCountryId const &)countryId onSuccess:(MWMVoidBlock)onSuccess { if (IsEnoughSpaceForDownload(countryId, GetFramework().GetStorage())) { @@ -80,9 +79,7 @@ using namespace storage; { GetFramework().ShowNode(countryId); } - -+ (void)downloadNodes:(TCountriesVec const &)countryIds - onSuccess:(TMWMVoidBlock)onSuccess ++ (void)downloadNodes:(TCountriesVec const &)countryIds onSuccess:(MWMVoidBlock)onSuccess { TMwmSize requiredSize = accumulate(countryIds.begin(), countryIds.end(), kMaxMwmSizeBytes, [](size_t const & size, TCountryId const & countryId) @@ -107,7 +104,7 @@ using namespace storage; } } -+ (void)checkConnectionAndPerformAction:(TMWMVoidBlock)action ++ (void)checkConnectionAndPerformAction:(MWMVoidBlock)action { switch (Platform::ConnectionStatus()) { diff --git a/iphone/Maps/UI/Editor/MWMEditorAdditionalNamesHeader.h b/iphone/Maps/UI/Editor/MWMEditorAdditionalNamesHeader.h index eae44e7108..87685c5e0a 100644 --- a/iphone/Maps/UI/Editor/MWMEditorAdditionalNamesHeader.h +++ b/iphone/Maps/UI/Editor/MWMEditorAdditionalNamesHeader.h @@ -1,6 +1,6 @@ @interface MWMEditorAdditionalNamesHeader : UIView -+ (instancetype)header:(TMWMVoidBlock)toggleBlock; ++ (instancetype)header:(MWMVoidBlock)toggleBlock; - (void)setShowAdditionalNames:(BOOL)showAdditionalNames; - (void)setAdditionalNamesVisible:(BOOL)visible; diff --git a/iphone/Maps/UI/Editor/MWMEditorAdditionalNamesHeader.mm b/iphone/Maps/UI/Editor/MWMEditorAdditionalNamesHeader.mm index 7be32891f9..be295f411b 100644 --- a/iphone/Maps/UI/Editor/MWMEditorAdditionalNamesHeader.mm +++ b/iphone/Maps/UI/Editor/MWMEditorAdditionalNamesHeader.mm @@ -5,14 +5,14 @@ @interface MWMEditorAdditionalNamesHeader () @property (weak, nonatomic) IBOutlet UILabel * label; -@property (copy, nonatomic) TMWMVoidBlock toggleBlock; +@property(copy, nonatomic) MWMVoidBlock toggleBlock; @property (weak, nonatomic) IBOutlet MWMButton * toggleButton; @end @implementation MWMEditorAdditionalNamesHeader -+ (instancetype)header:(TMWMVoidBlock)toggleBlock ++ (instancetype)header:(MWMVoidBlock)toggleBlock { MWMEditorAdditionalNamesHeader * h = [[[NSBundle mainBundle] loadNibNamed:[self className] owner:nil options:nil] firstObject]; diff --git a/iphone/Maps/UI/Migration/MWMMigrationViewController.mm b/iphone/Maps/UI/Migration/MWMMigrationViewController.mm index 7f4bdcdc50..b8418c6d70 100644 --- a/iphone/Maps/UI/Migration/MWMMigrationViewController.mm +++ b/iphone/Maps/UI/Migration/MWMMigrationViewController.mm @@ -22,7 +22,7 @@ using namespace storage; @interface MWMStorage () -+ (void)checkConnectionAndPerformAction:(TMWMVoidBlock)action; ++ (void)checkConnectionAndPerformAction:(MWMVoidBlock)action; @end diff --git a/iphone/Maps/UI/PlacePage/Deprecated/MWMPlacePageEntity.h b/iphone/Maps/UI/PlacePage/Deprecated/MWMPlacePageEntity.h index ade028658d..4842de29e6 100644 --- a/iphone/Maps/UI/PlacePage/Deprecated/MWMPlacePageEntity.h +++ b/iphone/Maps/UI/PlacePage/Deprecated/MWMPlacePageEntity.h @@ -73,7 +73,7 @@ using MWMPlacePageCellTypeValueMap = map; - (instancetype)initWithInfo:(place_page::Info const &)info; - (void)synchronize; -- (void)onlinePricingWithCompletionBlock:(TMWMVoidBlock)completion failure:(TMWMVoidBlock)failure; +- (void)onlinePricingWithCompletionBlock:(MWMVoidBlock)completion failure:(MWMVoidBlock)failure; - (void)toggleCoordinateSystem; diff --git a/iphone/Maps/UI/PlacePage/Deprecated/MWMPlacePageEntity.mm b/iphone/Maps/UI/PlacePage/Deprecated/MWMPlacePageEntity.mm index b44991cc95..c8bcbaf4d3 100644 --- a/iphone/Maps/UI/PlacePage/Deprecated/MWMPlacePageEntity.mm +++ b/iphone/Maps/UI/PlacePage/Deprecated/MWMPlacePageEntity.mm @@ -118,7 +118,7 @@ void initFieldsMap() } } -- (void)onlinePricingWithCompletionBlock:(TMWMVoidBlock)completion failure:(TMWMVoidBlock)failure +- (void)onlinePricingWithCompletionBlock:(MWMVoidBlock)completion failure:(MWMVoidBlock)failure { if (Platform::ConnectionStatus() == Platform::EConnectionType::CONNECTION_NONE || !self.isBooking) { diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Banner/MWMPPPreviewBannerCell.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/Banner/MWMPPPreviewBannerCell.mm index b725de1b92..718af151b8 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Banner/MWMPPPreviewBannerCell.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Banner/MWMPPPreviewBannerCell.mm @@ -77,7 +77,7 @@ CGFloat const kLineSpacing = 5; }]; } -- (void)downloadAssingImageWithURL:(NSURL *)URL completion:(TMWMVoidBlock)completion +- (void)downloadAssingImageWithURL:(NSURL *)URL completion:(MWMVoidBlock)completion { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSData * data = [NSData dataWithContentsOfURL:URL]; diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/OpeningHoursCell/MWMOpeningHoursLayoutHelper.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/OpeningHoursCell/MWMOpeningHoursLayoutHelper.mm index a60a0feb19..3f2edee2c2 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/OpeningHoursCell/MWMOpeningHoursLayoutHelper.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/OpeningHoursCell/MWMOpeningHoursLayoutHelper.mm @@ -20,7 +20,7 @@ @property(weak, nonatomic) IBOutlet UILabel * text; @property(weak, nonatomic) IBOutlet UIImageView * arrowIcon; -@property(copy, nonatomic) TMWMVoidBlock tapAction; +@property(copy, nonatomic) MWMVoidBlock tapAction; @end diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayoutImpl.h b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayoutImpl.h index 98890efc27..df9aad41f0 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayoutImpl.h +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayoutImpl.h @@ -5,7 +5,7 @@ namespace place_page_layout { NSTimeInterval const kAnimationSpeed = IPAD ? 0.15 : 0.25; -inline void animate(TMWMVoidBlock animate, TMWMVoidBlock completion = nil) +inline void animate(MWMVoidBlock animate, MWMVoidBlock completion = nil) { [UIView animateWithDuration:kAnimationSpeed delay:0 diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm index 43959a7f64..8625c36a67 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Preview/MWMPPPreviewLayoutHelper.mm @@ -17,7 +17,7 @@ @property(weak, nonatomic) IBOutlet UIImageView * compass; @property(weak, nonatomic) IBOutlet UIView * distanceView; @property(weak, nonatomic) IBOutlet NSLayoutConstraint * trailing; -@property(copy, nonatomic) TMWMVoidBlock tapOnDistance; +@property(copy, nonatomic) MWMVoidBlock tapOnDistance; @end diff --git a/iphone/Maps/UI/Search/MWMSearchManager.mm b/iphone/Maps/UI/Search/MWMSearchManager.mm index 9886582466..39360a0acd 100644 --- a/iphone/Maps/UI/Search/MWMSearchManager.mm +++ b/iphone/Maps/UI/Search/MWMSearchManager.mm @@ -333,7 +333,7 @@ typedef NS_ENUM(NSUInteger, MWMSearchManagerActionBarState) { } } -- (void)animateConstraints:(TMWMVoidBlock)block +- (void)animateConstraints:(MWMVoidBlock)block { UIView * parentView = self.ownerController.view; [parentView layoutIfNeeded];