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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// TAPKeyboardTableViewCell.m
// TapTalk
//
// Created by Welly Kencana on 10/10/18.
// Copyright © 2018 Moselo. All rights reserved.
//
#import "TAPKeyboardTableViewCell.h"
@interface TAPKeyboardTableViewCell ()
@property (strong, nonatomic) IBOutlet UILabel *stringLabel;
@property (strong, nonatomic) IBOutlet UILabel *emoticonLabel;
@property (strong, nonatomic) IBOutlet RNImageView *iconImageView;
@end
@implementation TAPKeyboardTableViewCell
#pragma mark - Lifecycle
- (void)awakeFromNib {
[super awakeFromNib];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
}
#pragma mark - Custom Method
- (void)setKeyboardCellWithType:(TAPKeyboardTableViewCellType)type {
NSString *titleString = @"";
NSString *emoticonString = @"";
if (type == TAPKeyboardTableViewCellTypePriceList) {
titleString = NSLocalizedString(@"See pricelist", @"");
emoticonString = @"👀";
}
else if (type == TAPKeyboardTableViewCellTypeExpertNotes) {
titleString = NSLocalizedString(@"Read expert’s notes", @"");
emoticonString = @"🔍";
}
else if (type == TAPKeyboardTableViewCellTypeSendService) {
titleString = NSLocalizedString(@"Send services", @"");
emoticonString = @"💌";
}
else if (type == TAPKeyboardTableViewCellTypeCreateOrderCard) {
titleString = NSLocalizedString(@"Create order card", @"");
emoticonString = @"✏️";
}
self.stringLabel.text = titleString;
self.emoticonLabel.text = emoticonString;
}
- (void)setKeyboardCellWithKeyboardItem:(TAPCustomKeyboardItemModel *)keyboardItem {
if(keyboardItem.iconImage != nil) {
self.iconImageView.image = keyboardItem.iconImage;
}
else {
[self.iconImageView setImageWithURLString:keyboardItem.iconURL];
}
self.stringLabel.text = keyboardItem.itemName;
}
@end