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

UITextView+RuntimeAttributes.mm « Maps « iphone - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9dc3a33ca129f1c7499456683f36802f81bf7840 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#import "UIFont+MapsMeFonts.h"
#import "UITextView+RuntimeAttributes.h"
#import "UIColor+MapsMeColor.h"

@implementation UITextView (RuntimeAttributes)

- (void)setLocalizedText:(NSString *)localizedText
{
  self.text = L(localizedText);
}

- (NSString *)localizedText
{
  return L(self.text);
}

- (void)setFontName:(NSString *)fontName
{
  self.font = [UIFont fontWithName:fontName];
}

- (void)setColorName:(NSString *)colorName
{
  self.textColor = [UIColor colorWithName:colorName];
}

- (void)setTintColorName:(NSString *)colorName
{
  self.tintColor = [UIColor colorWithName:colorName];
}

@end

@implementation MWMTextView (RuntimeAttributes)

- (void)setLocalizedPlaceholder:(NSString *)localizedPlaceholder
{
  self.placeholder = L(localizedPlaceholder);
}

- (NSString *)localizedPlaceholder
{
  return L(self.placeholder);
}

- (void)setPlaceholderColorName:(NSString *)placeholderColorName
{
  self.placeholderView.textColor = [UIColor colorWithName:placeholderColorName];
}

@end