Welcome to mirror list, hosted at ThFree Co, Russian Federation.

MWMBookmarkColorCell.mm « Classes « Maps « iphone - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0e967f9ee2beff6d325c357129fc137f8ede50f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#import "MWMBookmarkColorCell.h"
#import "UIKitCategories.h"

extern NSArray * const kBookmarkColorsVariant;

@interface MWMBookmarkColorCell ()

@property (copy, nonatomic) NSString * currentImageName;

@end

@implementation MWMBookmarkColorCell

- (void)configureWithColorString:(NSString *)colorString
{
  self.currentImageName = colorString;
  self.titleLabel.text = L([colorString stringByReplacingOccurrencesOfString:@"placemark-" withString:@""]);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
  [super setSelected:selected animated:animated];
  [self.colorButton setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@%@", self.currentImageName, selected ? @"-on" : @"-off"]] forState:UIControlStateNormal];
  self.approveImageView.hidden = !selected;
}

@end