Skip to content

Commit 692e302

Browse files
author
Jerome Chang
committed
add UITableViewCellSeparatorStyle support
1 parent dc4106c commit 692e302

File tree

8 files changed

+137
-1
lines changed

8 files changed

+137
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Bucket
3+
type = "1"
4+
version = "2.0">
5+
<Breakpoints>
6+
<BreakpointProxy
7+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
8+
<BreakpointContent
9+
shouldBeEnabled = "No"
10+
ignoreCount = "0"
11+
continueAfterRunningActions = "No"
12+
filePath = "RNTableView/RNTableViewManager.m"
13+
timestampString = "470139084.171355"
14+
startingColumnNumber = "9223372036854775807"
15+
endingColumnNumber = "9223372036854775807"
16+
startingLineNumber = "17"
17+
endingLineNumber = "17"
18+
landmarkName = "-view"
19+
landmarkType = "5">
20+
</BreakpointContent>
21+
</BreakpointProxy>
22+
</Breakpoints>
23+
</Bucket>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0710"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "873769941B7CD6E900F7C3C2"
18+
BuildableName = "libRNTableView.a"
19+
BlueprintName = "RNTableView"
20+
ReferencedContainer = "container:RNTableView.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
<AdditionalOptions>
33+
</AdditionalOptions>
34+
</TestAction>
35+
<LaunchAction
36+
buildConfiguration = "Debug"
37+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
38+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
39+
launchStyle = "0"
40+
useCustomWorkingDirectory = "NO"
41+
ignoresPersistentStateOnLaunch = "NO"
42+
debugDocumentVersioning = "YES"
43+
debugServiceExtension = "internal"
44+
allowLocationSimulation = "YES">
45+
<MacroExpansion>
46+
<BuildableReference
47+
BuildableIdentifier = "primary"
48+
BlueprintIdentifier = "873769941B7CD6E900F7C3C2"
49+
BuildableName = "libRNTableView.a"
50+
BlueprintName = "RNTableView"
51+
ReferencedContainer = "container:RNTableView.xcodeproj">
52+
</BuildableReference>
53+
</MacroExpansion>
54+
<AdditionalOptions>
55+
</AdditionalOptions>
56+
</LaunchAction>
57+
<ProfileAction
58+
buildConfiguration = "Release"
59+
shouldUseLaunchSchemeArgsEnv = "YES"
60+
savedToolIdentifier = ""
61+
useCustomWorkingDirectory = "NO"
62+
debugDocumentVersioning = "YES">
63+
<MacroExpansion>
64+
<BuildableReference
65+
BuildableIdentifier = "primary"
66+
BlueprintIdentifier = "873769941B7CD6E900F7C3C2"
67+
BuildableName = "libRNTableView.a"
68+
BlueprintName = "RNTableView"
69+
ReferencedContainer = "container:RNTableView.xcodeproj">
70+
</BuildableReference>
71+
</MacroExpansion>
72+
</ProfileAction>
73+
<AnalyzeAction
74+
buildConfiguration = "Debug">
75+
</AnalyzeAction>
76+
<ArchiveAction
77+
buildConfiguration = "Release"
78+
revealArchiveInOrganizer = "YES">
79+
</ArchiveAction>
80+
</Scheme>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>RNTableView.xcscheme</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
<key>SuppressBuildableAutocreation</key>
14+
<dict>
15+
<key>873769941B7CD6E900F7C3C2</key>
16+
<dict>
17+
<key>primary</key>
18+
<true/>
19+
</dict>
20+
</dict>
21+
</dict>
22+
</plist>

RNTableView/RNTableView.h

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
@property (nonatomic, assign) UITableViewStyle tableViewStyle;
4444
@property (nonatomic, assign) UITableViewCellStyle tableViewCellStyle;
45+
@property (nonatomic, assign) UITableViewCellSeparatorStyle separatorStyle;
4546
@property (nonatomic, strong) UIFont *font;
4647
@property (nonatomic, strong) UIFont *headerFont;
4748
@property (nonatomic, strong) UIColor *headerTextColor;

RNTableView/RNTableView.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ - (void)createTableView {
145145
UIView *view = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0.001, 0.001)];
146146
_tableView.tableHeaderView = view;
147147
_tableView.tableFooterView = view;
148-
148+
_tableView.separatorStyle = self.separatorStyle;
149149
[self addSubview:_tableView];
150150
}
151151
- (void)tableView:(UITableView *)tableView willDisplayFooterView:(nonnull UIView *)view forSection:(NSInteger)section {

RNTableView/RNTableViewManager.m

+9
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ - (UIView *)view
5353
[view setContentInset:[RCTConvert UIEdgeInsets:json]];
5454
}
5555

56+
RCT_CUSTOM_VIEW_PROPERTY(separatorStyle, UITableViewCellSeparatorStyle, RNTableView) {
57+
[view setSeparatorStyle:[RCTConvert UIEdgeInsets:json]];
58+
}
59+
5660
RCT_CUSTOM_VIEW_PROPERTY(contentOffset, CGPoint, RNTableView) {
5761
[view setContentOffset:[RCTConvert CGPoint:json]];
5862
}
@@ -72,6 +76,11 @@ - (NSDictionary *)constantsToExport {
7276
@"Value1": @(UITableViewCellStyleValue1),
7377
@"Value2": @(UITableViewCellStyleValue2),
7478
@"Subtitle": @(UITableViewCellStyleSubtitle)
79+
},
80+
@"SeparatorStyle": @{
81+
@"None": @(UITableViewCellSeparatorStyleNone),
82+
@"Line": @(UITableViewCellSeparatorStyleSingleLine),
83+
@"LineEtched": @(UITableViewCellSeparatorStyleSingleLineEtched)
7584
}
7685
};
7786
}

index.js

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ var TableView = React.createClass({
125125
additionalItems={this.state.additionalItems}
126126
tableViewStyle={TableView.Consts.Style.Plain}
127127
tableViewCellStyle={TableView.Consts.CellStyle.Subtitle}
128+
separatorStyle={TableView.Consts.SeparatorStyle.Line}
128129
scrollIndicatorInsets={this.props.contentInset}
129130
{...this.props}
130131
json={this.state.json}

0 commit comments

Comments
 (0)