mirror of
https://github.com/zhigang1992/RETableViewManager.git
synced 2026-06-12 09:08:59 +08:00
Use RETableViewItem as base item class
This commit is contained in:
@@ -27,6 +27,4 @@
|
||||
|
||||
@interface RETableViewStringCell : RETableViewCell
|
||||
|
||||
@property (strong, readwrite, nonatomic) NSString *item;
|
||||
|
||||
@end
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
- (void)prepare
|
||||
{
|
||||
if ([self.item isKindOfClass:[NSString class]]) {
|
||||
self.textLabel.text = self.item;
|
||||
self.textLabel.text = (NSString *)self.item;
|
||||
} else {
|
||||
RETableViewItem *item = (RETableViewItem *)self.item;
|
||||
self.textLabel.text = item.title;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#import "REActionBar.h"
|
||||
|
||||
@class RETableViewManager;
|
||||
@class RETableViewItem;
|
||||
|
||||
@interface RETableViewCell : UITableViewCell <REActionBarDelegate>
|
||||
|
||||
@@ -37,7 +38,7 @@
|
||||
@property (weak, readwrite, nonatomic) UITableView *parentTableView;
|
||||
@property (weak, readwrite, nonatomic) RETableViewManager *tableViewManager;
|
||||
@property (weak, readwrite, nonatomic) RETableViewSection *section;
|
||||
@property (strong, readwrite, nonatomic) NSObject *item;
|
||||
@property (strong, readwrite, nonatomic) RETableViewItem *item;
|
||||
@property (strong, readwrite, nonatomic) REActionBar *actionBar;
|
||||
|
||||
+ (CGFloat)heightWithItem:(NSObject *)item tableViewManager:(RETableViewManager *)tableViewManager;
|
||||
|
||||
@@ -31,15 +31,15 @@
|
||||
@interface RETableViewItem : NSObject
|
||||
|
||||
@property (copy, readwrite, nonatomic) NSString *title;
|
||||
@property (copy, readwrite, nonatomic) void (^actionBlock)(id item);
|
||||
@property (copy, readwrite, nonatomic) void (^accessoryButtonActionBlock)(id item);
|
||||
@property (weak, readwrite, nonatomic) RETableViewSection *section;
|
||||
@property (assign, readwrite, nonatomic) BOOL performActionOnSelection;
|
||||
@property (assign, readonly, nonatomic) BOOL canFocus;
|
||||
@property (weak, readwrite, nonatomic) RETableViewSection *section;
|
||||
@property (copy, readwrite, nonatomic) NSString *detailLabelText;
|
||||
@property (assign, readwrite, nonatomic) UITableViewCellStyle cellStyle;
|
||||
@property (assign, readwrite, nonatomic) UITableViewCellAccessoryType accessoryType;
|
||||
@property (strong, readwrite, nonatomic) UIView *accessoryView;
|
||||
@property (copy, readwrite, nonatomic) void (^actionBlock)(id item);
|
||||
@property (copy, readwrite, nonatomic) void (^accessoryButtonActionBlock)(id item);
|
||||
|
||||
+ (id)item;
|
||||
+ (id)itemWithTitle:(NSString *)title accessoryType:(UITableViewCellAccessoryType)accessoryType actionBlock:(void(^)(RETableViewItem *item))actionBlock;
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
RETableViewSection *section = [_sections objectAtIndex:indexPath.section];
|
||||
NSObject *item = [section.items objectAtIndex:indexPath.row];
|
||||
RETableViewItem *item = [section.items objectAtIndex:indexPath.row];
|
||||
|
||||
UITableViewCellStyle cellStyle = UITableViewCellStyleDefault;
|
||||
if ([item isKindOfClass:[RETableViewItem class]])
|
||||
|
||||
@@ -217,10 +217,10 @@
|
||||
30DB065616E934AD006C9530 /* RECreditCardItem.m */,
|
||||
30DB065716E934AD006C9530 /* RENumberItem.h */,
|
||||
30DB065816E934AD006C9530 /* RENumberItem.m */,
|
||||
30DB065B16E934AD006C9530 /* RETextItem.h */,
|
||||
30DB065C16E934AD006C9530 /* RETextItem.m */,
|
||||
30F41319170E0F620004EBAE /* RERadioItem.h */,
|
||||
30F4131A170E0F620004EBAE /* RERadioItem.m */,
|
||||
30DB065B16E934AD006C9530 /* RETextItem.h */,
|
||||
30DB065C16E934AD006C9530 /* RETextItem.m */,
|
||||
);
|
||||
path = Items;
|
||||
sourceTree = "<group>";
|
||||
|
||||
Reference in New Issue
Block a user