diff --git a/iphone/Maps/Classes/SearchUniversalCell.h b/iphone/Maps/Classes/SearchUniversalCell.h index d87534e4e9..1a70d09cbb 100644 --- a/iphone/Maps/Classes/SearchUniversalCell.h +++ b/iphone/Maps/Classes/SearchUniversalCell.h @@ -11,7 +11,6 @@ @property (nonatomic, readonly) UIImageView * iconImageView; - (void)setTitle:(NSString *)title selectedRanges:(NSArray *)selectedRanges; -- (void)setSubtitle:(NSString *)subtitle selectedRange:(NSRange)selectedRange; + (CGFloat)cellHeightWithTitle:(NSString *)title type:(NSString *)type subtitle:(NSString *)subtitle distance:(NSString *)distance viewWidth:(CGFloat)width; diff --git a/iphone/Maps/Classes/SearchUniversalCell.m b/iphone/Maps/Classes/SearchUniversalCell.m index e564d3a4b4..c7b3934e1d 100644 --- a/iphone/Maps/Classes/SearchUniversalCell.m +++ b/iphone/Maps/Classes/SearchUniversalCell.m @@ -51,27 +51,6 @@ self.titleLabel.attributedText = attributedTitle; } -- (void)setSubtitle:(NSString *)subtitle selectedRange:(NSRange)selectedRange -{ - if (!subtitle) - subtitle = @""; - NSMutableAttributedString * attributedSubtitle = [[NSMutableAttributedString alloc] initWithString:subtitle]; - if (selectedRange.location == NSNotFound) - { - [attributedSubtitle addAttributes:[self unselectedSubtitleAttributes] range:NSMakeRange(0, [subtitle length])]; - } - else - { - NSRange unselectedRange1 = NSMakeRange(0, selectedRange.location); - NSRange unselectedRange2 = NSMakeRange(selectedRange.location + selectedRange.length, [subtitle length] - selectedRange.location - selectedRange.length); - - [attributedSubtitle addAttributes:[self selectedSubtitleAttributes] range:selectedRange]; - [attributedSubtitle addAttributes:[self unselectedSubtitleAttributes] range:unselectedRange1]; - [attributedSubtitle addAttributes:[self unselectedSubtitleAttributes] range:unselectedRange2]; - } - self.subtitleLabel.attributedText = attributedSubtitle; -} - - (NSDictionary *)selectedSubtitleAttributes { static NSDictionary * selectedAttributes; diff --git a/iphone/Maps/Classes/SearchView.mm b/iphone/Maps/Classes/SearchView.mm index 721fbfff48..c0388ba3ee 100644 --- a/iphone/Maps/Classes/SearchView.mm +++ b/iphone/Maps/Classes/SearchView.mm @@ -192,7 +192,7 @@ __weak SearchView * selfPointer; [self.searchBar.textField becomeFirstResponder]; [UIView animateWithDuration:0.25 delay:0. options:UIViewAnimationOptionCurveEaseInOut animations:^{ self.tableView.alpha = 1; - } completion:^(BOOL finished) {}]; + } completion:nil]; [UIView animateWithDuration:duration delay:0 damping:damping initialVelocity:0 options:options animations:^{ self.searchBar.cancelButton.alpha = 1; self.topBackgroundView.minY = 0; @@ -455,8 +455,8 @@ static void onSearchResultCallback(search::Results const & results) { SearchUniversalCell * customCell = [tableView dequeueReusableCellWithIdentifier:[SearchUniversalCell className]]; - [customCell setTitle:NSLocalizedString(self.categoriesNames[indexPath.row], nil) selectedRange:NSMakeRange(0, 0)]; - [customCell setSubtitle:nil selectedRange:NSMakeRange(0, 0)]; + [customCell setTitle:NSLocalizedString(self.categoriesNames[indexPath.row], nil) selectedRanges:nil]; + customCell.subtitleLabel.text = nil; customCell.iconImageView.image = [UIImage imageNamed:@"SearchCellSpotIcon"]; customCell.distanceLabel.text = nil; customCell.typeLabel.text = nil; @@ -467,8 +467,8 @@ static void onSearchResultCallback(search::Results const & results) { SearchUniversalCell * customCell = [tableView dequeueReusableCellWithIdentifier:[SearchUniversalCell className]]; - [customCell setTitle:NSLocalizedString(@"search_show_on_map", nil) selectedRange:NSMakeRange(0, 0)]; - [customCell setSubtitle:nil selectedRange:NSMakeRange(0, 0)]; + [customCell setTitle:NSLocalizedString(@"search_show_on_map", nil) selectedRanges:nil]; + customCell.subtitleLabel.text = nil; customCell.iconImageView.image = [UIImage imageNamed:@"SearchCellPinsIcon"]; customCell.distanceLabel.text = nil; customCell.typeLabel.text = nil; @@ -490,8 +490,7 @@ static void onSearchResultCallback(search::Results const & results) } NSString * title = [NSString stringWithUTF8String:result.GetString()]; [customCell setTitle:title selectedRanges:ranges]; - NSString * subtitle = [NSString stringWithUTF8String:result.GetRegionString()]; - [customCell setSubtitle:subtitle selectedRange:NSMakeRange(0, 0)]; + customCell.subtitleLabel.text = [NSString stringWithUTF8String:result.GetRegionString()]; customCell.iconImageView.image = [UIImage imageNamed:@"SearchCellPinIcon"]; customCell.distanceLabel.text = self.wrapper.distances[@(position)]; customCell.typeLabel.text = [NSString stringWithUTF8String:result.GetFeatureType()];