From f3ef359983c58591d44accf6d3265144e62a8931 Mon Sep 17 00:00:00 2001 From: Kiryl Kaveryn Date: Sat, 16 Mar 2024 14:09:43 +0400 Subject: [PATCH] [ios] fix bug when the user's 'saved bookmark' tab icon has wrong selected state color and icon Signed-off-by: Kiryl Kaveryn --- .../PlacePageLayout/ActionBar/MWMActionBarButton.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.m b/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.m index 5b9ce7080c..1b4da13d6a 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.m +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.m @@ -201,7 +201,11 @@ NSString *titleForButton(MWMActionBarButtonType type, BOOL isSelected) { - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { [super traitCollectionDidChange:previousTraitCollection]; - [self.button setSelected:false]; + if (@available(iOS 13.0, *)) { + if ([self.traitCollection hasDifferentColorAppearanceComparedToTraitCollection:previousTraitCollection]) + // Update button for the current selection state. + [self.button setSelected:self.button.isSelected]; + } } - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {