-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathCountryCodeCell.m
52 lines (47 loc) · 1.71 KB
/
CountryCodeCell.m
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
52
//
// CountryCodeCell.m
// CodingMart
//
// Created by Ease on 16/5/11.
// Copyright © 2016年 net.coding. All rights reserved.
//
#import "CountryCodeCell.h"
@interface CountryCodeCell ()
@property (strong, nonatomic) UILabel *leftL;
@property (strong, nonatomic) UILabel *rightL;
@end
@implementation CountryCodeCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
_leftL = ({
UILabel *label = [UILabel new];
label.font = [UIFont systemFontOfSize:15];
label.textColor = kColorDark2;
[self.contentView addSubview:label];
[label mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView).offset(kPaddingLeftWidth);
make.centerY.equalTo(self.contentView);
}];
label;
});
_rightL = ({
UILabel *label = [UILabel new];
label.font = [UIFont systemFontOfSize:15];
label.textColor = [UIColor colorWithHexString:@"0x136BFB"];
[self.contentView addSubview:label];
[label mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView).offset(-kPaddingLeftWidth);
make.centerY.equalTo(self.contentView);
}];
label;
});
}
return self;
}
- (void)setCountryCodeDict:(NSDictionary *)countryCodeDict{
_countryCodeDict = countryCodeDict;
_leftL.text = _countryCodeDict[@"country"];
_rightL.text = [NSString stringWithFormat:@"+%@", _countryCodeDict[@"country_code"]];
}
@end