Skip to content

Commit b5c4853

Browse files
authored
3.0.0 #209
2 parents 20a4f31 + 5fb84ed commit b5c4853

File tree

2 files changed

+41
-18
lines changed

2 files changed

+41
-18
lines changed

README.md

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,39 @@
4949

5050
## Installation
5151

52-
1. Installation
53-
- Using npm: `npm install react-native-tableview --save`
54-
- Using yarn: `yarn add react-native-tableview`
55-
2. Link
56-
- `react-native link react-native-tableview`
57-
- If fails, follow manual linking steps below
58-
3. (optional) If you will use JSON file, add it to iOS application bundle
59-
4. Import it in your JS:
60-
61-
```js
62-
import TableView from 'react-native-tableview';
63-
```
64-
65-
### Manual Linking
52+
Using npm:
53+
54+
```bash
55+
npm install react-native-tableview --save
56+
```
57+
58+
or using yarn:
59+
60+
```bash
61+
yarn add react-native-tableview
62+
```
63+
64+
> ⚠️ If you are on React Native < 0.60.0, you must use version 2.x.x of this library
65+
66+
### Pods
67+
68+
> If using CocoaPods or React Native version >= 0.60.0
69+
70+
```bash
71+
cd ios && pod install && cd ..
72+
```
73+
74+
### Linking
75+
76+
> For React Native <= 0.59 only
77+
78+
```bash
79+
react-native link react-native-tableview
80+
```
81+
82+
If fails, follow manual linking steps below,
83+
84+
#### Manual Linking
6685

6786
1. In XCode, in the project navigator, right click Libraries ➜ Add Files to
6887
[your project's name]

RNTableView/RNTableViewManager.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#import <React/RCTConvert.h>
1313
#import <React/RCTFont.h>
1414
#import <React/RCTUIManager.h>
15+
#import <React/RCTComponentEvent.h>
1516

1617
@implementation RNTableViewManager
1718

@@ -253,7 +254,10 @@ - (NSDictionary *)constantsToExport {
253254

254255
RCT_EXPORT_METHOD(sendNotification:(NSDictionary *)data)
255256
{
256-
[self.bridge.eventDispatcher sendInputEventWithName:@"onItemNotification" body:data];
257+
RCTComponentEvent *event = [[RCTComponentEvent alloc] initWithName:@"onItemNotification"
258+
viewTag:nil
259+
body:data];
260+
[self.bridge.eventDispatcher sendEvent:event];
257261
}
258262

259263
RCT_EXPORT_METHOD(scrollTo:(nonnull NSNumber *)reactTag
@@ -276,7 +280,7 @@ - (NSDictionary *)constantsToExport {
276280
[self.bridge.uiManager addUIBlock:
277281
^(__unused RCTUIManager *uiManager, NSDictionary *viewRegistry){
278282
RNTableView *tableView = viewRegistry[reactTag];
279-
283+
280284
if ([tableView isKindOfClass:[RNTableView class]]) {
281285
[tableView startRefreshing];
282286
} else {
@@ -290,7 +294,7 @@ - (NSDictionary *)constantsToExport {
290294
[self.bridge.uiManager addUIBlock:
291295
^(__unused RCTUIManager *uiManager, NSDictionary *viewRegistry){
292296
RNTableView *tableView = viewRegistry[reactTag];
293-
297+
294298
if ([tableView isKindOfClass:[RNTableView class]]) {
295299
[tableView stopRefreshing];
296300
} else {
@@ -307,7 +311,7 @@ - (NSDictionary *)constantsToExport {
307311
[self.bridge.uiManager addUIBlock:
308312
^(__unused RCTUIManager *uiManager, NSDictionary *viewRegistry){
309313
RNTableView *tableView = viewRegistry[reactTag];
310-
314+
311315
if ([tableView isKindOfClass:[RNTableView class]]) {
312316
[tableView scrollToIndex:index section:section animated:animated];
313317
} else {

0 commit comments

Comments
 (0)