-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRCTTableViewManager.m
47 lines (36 loc) · 1.26 KB
/
RCTTableViewManager.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
#import "RCTTableViewManager.h"
#import "RCTBridge.h"
#import "RCTConvert.h"
#import "RCTSparseArray.h"
#import "RCTUIManager.h"
#import "RCTTableView.h"
//@import UIKit;
@implementation RCTTableViewManager
RCT_EXPORT_MODULE()
- (UIView *)view {
return [[RCTTableView alloc] initWithEventDispatcher:self.bridge.eventDispatcher];;
}
RCT_CUSTOM_VIEW_PROPERTY(tableViewStyle, UITableViewStyle, RCTTableView) {
[view setTableViewStyle:[RCTConvert NSInteger:json]];
}
// RCT_EXPORT_VIEW_PROPERTY(numberOfSections, NSInteger)
// RCT_EXPORT_VIEW_PROPERTY(numberOfRowsInSection, NSArray)
RCT_EXPORT_VIEW_PROPERTY(cellForRowAtIndexPath, NSArray)
RCT_CUSTOM_VIEW_PROPERTY(tableViewCellStyle, UITableViewStyle, RCTTableView) {
[view setTableViewCellStyle:[RCTConvert NSInteger:json]];
}
- (NSDictionary *)constantsToExport {
return @{
@"Style": @{
@"Plain": @(UITableViewStylePlain),
@"Grouped": @(UITableViewStyleGrouped)
},
@"CellStyle": @{
@"Default": @(UITableViewCellStyleDefault),
@"Value1": @(UITableViewCellStyleValue1),
@"Value2": @(UITableViewCellStyleValue2),
@"Subtitle": @(UITableViewCellStyleSubtitle)
}
};
}
@end