Skip to content

Commit b887456

Browse files
authored
Fix broken compilation in v1.1.0 (#44)
Fix broken compilation in v1.1.0
2 parents b8ef87f + 76656e9 commit b887456

File tree

4 files changed

+33
-8
lines changed

4 files changed

+33
-8
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@ or npm:
2020
npm install --save @react-native-community/segmented-control
2121
```
2222

23+
## Link
24+
25+
- React Native 0.60+
26+
27+
run `cd ios && pod install`
28+
29+
- React Native <= 0.59
30+
31+
run `react-native link @react-native-community/segmented-control`
32+
33+
or you can follow the instructions to [manually link this package](https://facebook.github.io/react-native/docs/linking-libraries-ios#manual-linking).
34+
35+
## Upgrading to React Native _0.60+_
36+
37+
New React Native comes with `autolinking` feature, which automatically links Native Modules in your project. In order to get it to work, make sure you unlink `Segmented Control` first:
38+
39+
`react-native unlink @react-native-community/segmented-control`
40+
2341
## Migrating from the core `react-native` module
2442

2543
This module was created when the segmentedControlIos was split out from the core of React Native. To migrate to this module you need to follow the installation instructions above and then change you imports from:

ios/RNCSegmentedControl.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
#import "RNCSegmentedControl.h"
99

10-
#import "RCTConvert.h"
11-
#import "RCTEventDispatcher.h"
12-
#import "UIView+React.h"
10+
#import <React/RCTConvert.h>
11+
#import <React/RCTEventDispatcher.h>
12+
#import <React/UIView+React.h>
1313

1414
@implementation RNCSegmentedControl
1515

ios/RNCSegmentedControl.xcodeproj/project.pbxproj

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/* Begin PBXBuildFile section */
1010
B3E7B58A1CC2AC0600A0062D /* RNCSegmentedControl.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNCSegmentedControl.m */; };
11+
E1248FAB23D5F9D700C2FB80 /* RNCSegmentedControlManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E1248FAA23D5F9D700C2FB80 /* RNCSegmentedControlManager.m */; };
1112
/* End PBXBuildFile section */
1213

1314
/* Begin PBXCopyFilesBuildPhase section */
@@ -26,6 +27,8 @@
2627
134814201AA4EA6300B7C361 /* libRNCSegmentedControl.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNCSegmentedControl.a; sourceTree = BUILT_PRODUCTS_DIR; };
2728
B3E7B5881CC2AC0600A0062D /* RNCSegmentedControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCSegmentedControl.h; sourceTree = "<group>"; };
2829
B3E7B5891CC2AC0600A0062D /* RNCSegmentedControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCSegmentedControl.m; sourceTree = "<group>"; };
30+
E1248FA923D5F9D700C2FB80 /* RNCSegmentedControlManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCSegmentedControlManager.h; sourceTree = "<group>"; };
31+
E1248FAA23D5F9D700C2FB80 /* RNCSegmentedControlManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCSegmentedControlManager.m; sourceTree = "<group>"; };
2932
/* End PBXFileReference section */
3033

3134
/* Begin PBXFrameworksBuildPhase section */
@@ -50,6 +53,8 @@
5053
58B511D21A9E6C8500147676 = {
5154
isa = PBXGroup;
5255
children = (
56+
E1248FA923D5F9D700C2FB80 /* RNCSegmentedControlManager.h */,
57+
E1248FAA23D5F9D700C2FB80 /* RNCSegmentedControlManager.m */,
5358
B3E7B5881CC2AC0600A0062D /* RNCSegmentedControl.h */,
5459
B3E7B5891CC2AC0600A0062D /* RNCSegmentedControl.m */,
5560
134814211AA4EA7D00B7C361 /* Products */,
@@ -95,6 +100,7 @@
95100
developmentRegion = English;
96101
hasScannedForEncodings = 0;
97102
knownRegions = (
103+
English,
98104
en,
99105
);
100106
mainGroup = 58B511D21A9E6C8500147676;
@@ -112,6 +118,7 @@
112118
isa = PBXSourcesBuildPhase;
113119
buildActionMask = 2147483647;
114120
files = (
121+
E1248FAB23D5F9D700C2FB80 /* RNCSegmentedControlManager.m in Sources */,
115122
B3E7B58A1CC2AC0600A0062D /* RNCSegmentedControl.m in Sources */,
116123
);
117124
runOnlyForDeploymentPostprocessing = 0;
@@ -204,14 +211,14 @@
204211
isa = XCBuildConfiguration;
205212
buildSettings = {
206213
HEADER_SEARCH_PATHS = (
207-
"$(inherited)",
214+
"$(inherited)",
208215
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
209216
"$(SRCROOT)/../../../React/**",
210217
"$(SRCROOT)/../../react-native/React/**",
211218
);
212219
LIBRARY_SEARCH_PATHS = "$(inherited)";
213220
OTHER_LDFLAGS = "-ObjC";
214-
PRODUCT_NAME = RNCViewpager;
221+
PRODUCT_NAME = RNCSegmentedControl;
215222
SKIP_INSTALL = YES;
216223
};
217224
name = Debug;
@@ -227,7 +234,7 @@
227234
);
228235
LIBRARY_SEARCH_PATHS = "$(inherited)";
229236
OTHER_LDFLAGS = "-ObjC";
230-
PRODUCT_NAME = RNCViewpager;
237+
PRODUCT_NAME = RNCSegmentedControl;
231238
SKIP_INSTALL = YES;
232239
};
233240
name = Release;

ios/RNCSegmentedControlManager.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#import "RNCSegmentedControlManager.h"
99

10-
#import "RCTBridge.h"
11-
#import "RCTConvert.h"
10+
#import <React/RCTBridge.h>
11+
#import <React/RCTConvert.h>
1212
#import "RNCSegmentedControl.h"
1313

1414
@implementation RNCSegmentedControlManager

0 commit comments

Comments
 (0)