diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchCommonCell.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchCommonCell.mm index 0fbbd47c7d..cdf9f806ed 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchCommonCell.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchCommonCell.mm @@ -9,6 +9,16 @@ #include "indexer/mercator.hpp" #include "platform/measurement_utils.hpp" +static NSDictionary * const selectedAttributes = @{ + NSForegroundColorAttributeName : UIColor.blackPrimaryText, + NSFontAttributeName : UIFont.bold17 +}; + +static NSDictionary * const unselectedAttributes = @{ + NSForegroundColorAttributeName : UIColor.blackPrimaryText, + NSFontAttributeName : UIFont.regular17 +}; + @interface MWMSearchCommonCell () @property (weak, nonatomic) IBOutlet UILabel * typeLabel; @@ -87,19 +97,11 @@ - (NSDictionary *)selectedTitleAttributes { - static NSDictionary * selectedAttributes; - if (!selectedAttributes) - selectedAttributes = @{NSForegroundColorAttributeName : UIColor.blackPrimaryText, - NSFontAttributeName : UIFont.bold17}; return selectedAttributes; } - (NSDictionary *)unselectedTitleAttributes { - static NSDictionary * unselectedAttributes; - if (!unselectedAttributes) - unselectedAttributes = @{NSForegroundColorAttributeName : UIColor.blackPrimaryText, - NSFontAttributeName : UIFont.regular17}; return unselectedAttributes; } diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchSuggestionCell.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchSuggestionCell.mm index 96657c6279..a7a9fbaac5 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchSuggestionCell.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchSuggestionCell.mm @@ -2,6 +2,12 @@ #import "UIColor+MapsMeColor.h" #import "UIFont+MapsMeFonts.h" +static NSDictionary * const selectedAttributes = + @{NSForegroundColorAttributeName : UIColor.linkBlue, NSFontAttributeName : UIFont.bold16}; + +static NSDictionary * const unselectedAttributes = + @{NSForegroundColorAttributeName : UIColor.linkBlue, NSFontAttributeName : UIFont.regular16}; + @interface MWMSearchSuggestionCell () @property (weak, nonatomic) IBOutlet UIImageView * icon; @@ -13,19 +19,11 @@ - (NSDictionary *)selectedTitleAttributes { - static NSDictionary * selectedAttributes; - if (!selectedAttributes) - selectedAttributes = @{NSForegroundColorAttributeName : UIColor.linkBlue, - NSFontAttributeName : UIFont.bold16}; return selectedAttributes; } - (NSDictionary *)unselectedTitleAttributes { - static NSDictionary * unselectedAttributes; - if (!unselectedAttributes) - unselectedAttributes = @{NSForegroundColorAttributeName : UIColor.linkBlue, - NSFontAttributeName : UIFont.regular16}; return unselectedAttributes; }