GeezerVison is showing github.com — Change prepare to cellWillAppear · zhmios/RETableViewManager@d910068
File tree
Expand file treeCollapse file tree
Open diff view settings
RETableViewManagerExample/RETableViewManagerExample/Classes/Views
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: RETableViewManager/Cells/RETableViewBoolCell.m +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -45,7 +45,7 @@ - (void)cellDidLoad |
45 | 45 | self.accessoryView = _switchView; |
46 | 46 | } |
47 | 47 |
|
48 | | -- (void)prepare |
| 48 | +- (void)cellWillAppear |
49 | 49 | { |
50 | 50 | self.textLabel.text = self.item.title; |
51 | 51 | _switchView.on = self.item.value; |
|
Collapse file
Copy file name to clipboardExpand all lines: RETableViewManager/Cells/RETableViewNumberCell.m +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,9 +34,9 @@ - (void)cellDidLoad |
34 | 34 | [self addSubview:self.textField]; |
35 | 35 | } |
36 | 36 |
|
37 | | -- (void)prepare |
| 37 | +- (void)cellWillAppear |
38 | 38 | { |
39 | | - [super prepare]; |
| 39 | + [super cellWillAppear]; |
40 | 40 |
|
41 | 41 | self.textLabel.text = self.item.title; |
42 | 42 | self.textField.text = self.item.value; |
|
Collapse file
Copy file name to clipboardExpand all lines: RETableViewManager/Cells/RETableViewTextCell.m +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -60,9 +60,9 @@ - (void)setSelected:(BOOL)selected animated:(BOOL)animated |
60 | 60 | } |
61 | 61 | } |
62 | 62 |
|
63 | | -- (void)prepare |
| 63 | +- (void)cellWillAppear |
64 | 64 | { |
65 | | - [super prepare]; |
| 65 | + [super cellWillAppear]; |
66 | 66 |
|
67 | 67 | self.textLabel.text = self.item.title; |
68 | 68 | _textField.text = self.item.value; |
|
Collapse file
Copy file name to clipboardExpand all lines: RETableViewManager/RETableViewCell.h +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
44 | 44 | + (CGFloat)heightWithItem:(NSObject *)item tableViewManager:(RETableViewManager *)tableViewManager; |
45 | 45 |
|
46 | 46 | - (void)cellDidLoad; |
47 | | -- (void)prepare; |
| 47 | +- (void)cellWillAppear; |
48 | 48 | - (void)refreshActionBar; |
49 | 49 |
|
50 | 50 | - (UIResponder *)responder; |
|
Collapse file
Copy file name to clipboardExpand all lines: RETableViewManager/RETableViewCell.m +14-11Lines changed: 14 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
28 | 28 |
|
29 | 29 | @implementation RETableViewCell |
30 | 30 |
|
| 31 | ++ (CGFloat)heightWithItem:(NSObject *)item tableViewManager:(RETableViewManager *)tableViewManager |
| 32 | +{ |
| 33 | + return tableViewManager.style.cellHeight; |
| 34 | +} |
| 35 | + |
31 | 36 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier |
32 | 37 | { |
33 | 38 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; |
@@ -37,6 +42,9 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus |
37 | 42 | return self; |
38 | 43 | } |
39 | 44 |
|
| 45 | +#pragma mark - |
| 46 | +#pragma mark Cell life cycle |
| 47 | + |
40 | 48 | - (void)cellDidLoad |
41 | 49 | { |
42 | 50 | self.actionBar = [[REActionBar alloc] initWithDelegate:self]; |
@@ -49,17 +57,7 @@ - (void)cellDidLoad |
49 | 57 | } |
50 | 58 | } |
51 | 59 |
|
52 | | -- (BOOL)hasCustomBackgroundImage |
53 | | -{ |
54 | | - return [self.tableViewManager.style backgroundImageForCellType:RETableViewCellFirst] || [self.tableViewManager.style backgroundImageForCellType:RETableViewCellMiddle] || [self.tableViewManager.style backgroundImageForCellType:RETableViewCellLast] || [self.tableViewManager.style backgroundImageForCellType:RETableViewCellSingle]; |
55 | | -} |
56 | | - |
57 | | -+ (CGFloat)heightWithItem:(NSObject *)item tableViewManager:(RETableViewManager *)tableViewManager |
58 | | -{ |
59 | | - return tableViewManager.style.cellHeight; |
60 | | -} |
61 | | - |
62 | | -- (void)prepare |
| 60 | +- (void)cellWillAppear |
63 | 61 | { |
64 | 62 | [self refreshActionBar]; |
65 | 63 |
|
@@ -73,6 +71,11 @@ - (void)prepare |
73 | 71 | } |
74 | 72 | } |
75 | 73 |
|
| 74 | +- (BOOL)hasCustomBackgroundImage |
| 75 | +{ |
| 76 | + return [self.tableViewManager.style backgroundImageForCellType:RETableViewCellFirst] || [self.tableViewManager.style backgroundImageForCellType:RETableViewCellMiddle] || [self.tableViewManager.style backgroundImageForCellType:RETableViewCellLast] || [self.tableViewManager.style backgroundImageForCellType:RETableViewCellSingle]; |
| 77 | +} |
| 78 | + |
76 | 79 | - (void)refreshActionBar |
77 | 80 | { |
78 | 81 | [self.actionBar.navigationControl setEnabled:[self indexPathForPreviousResponder] != nil forSegmentAtIndex:0]; |
|
Collapse file
Copy file name to clipboardExpand all lines: RETableViewManager/RETableViewManager.m +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -129,7 +129,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N |
129 | 129 |
|
130 | 130 | if ([item isKindOfClass:[RETableViewItem class]]) |
131 | 131 | cell.detailTextLabel.text = ((RETableViewItem *)item).detailLabelText; |
132 | | - [cell prepare]; |
| 132 | + [cell cellWillAppear]; |
133 | 133 |
|
134 | 134 | if ([_delegate respondsToSelector:@selector(tableView:styleCell:atIndexPath:)]) |
135 | 135 | [_delegate tableView:tableView styleCell:cell atIndexPath:indexPath]; |
|
Collapse file
Copy file name to clipboardExpand all lines: RETableViewManagerExample/RETableViewManagerExample/Classes/Views/ListImageCell.m +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -26,9 +26,9 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus |
26 | 26 | return self; |
27 | 27 | } |
28 | 28 |
|
29 | | -- (void)prepare |
| 29 | +- (void)cellWillAppear |
30 | 30 | { |
31 | | - [super prepare]; |
| 31 | + [super cellWillAppear]; |
32 | 32 | [_pictureView setImageWithURL:self.item.imageURL]; |
33 | 33 | } |
34 | 34 |
|
|