Skip to content

Commit 9f09e36

Browse files
authored
Merge pull request #149 from mixslice/rn_0.50_xcode_9_latest_compatible
RN 0.50 and Xcode 9 compatible
2 parents 7b2a09b + 9825d68 commit 9f09e36

File tree

12 files changed

+130
-37
lines changed

12 files changed

+130
-37
lines changed

example/ios/Podfile

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1+
react_native_path = '../../node_modules/react-native'
2+
13
use_frameworks!
24

35
project 'native-navigation.xcodeproj'
46

57
target 'native-navigation' do
6-
pod 'Yoga', :path => '../../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'
78
pod 'native-navigation', :path => '../../'
8-
pod 'React', :path => '../../node_modules/react-native', :subspecs => [
9+
10+
# To use CocoaPods with React Native, you need to add this specific Yoga spec as well
11+
pod 'yoga', :path => react_native_path + '/ReactCommon/yoga/yoga.podspec'
12+
13+
# Third party deps used for CxxBridge
14+
pod 'DoubleConversion', :podspec => react_native_path + '/third-party-podspecs/DoubleConversion.podspec'
15+
pod 'GLog', :podspec => react_native_path + '/third-party-podspecs/GLog.podspec'
16+
pod 'Folly', :podspec => react_native_path + '/third-party-podspecs/Folly.podspec'
17+
18+
pod 'React', :path => react_native_path, :subspecs => [
919
'Core',
20+
'DevSupport',
21+
'CxxBridge',
1022
'RCTText',
1123
'RCTNetwork',
1224
'RCTWebSocket', # needed for debugging

example/ios/Podfile.lock

+75-23
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,102 @@
11
PODS:
2-
- native-navigation (0.1.0):
2+
- boost (1.59.0):
3+
- boost/graph-includes (= 1.59.0)
4+
- boost/math-includes (= 1.59.0)
5+
- boost/numeric-includes (= 1.59.0)
6+
- boost/pointer_cast-includes (= 1.59.0)
7+
- boost/preprocessor-includes (= 1.59.0)
8+
- boost/shared_ptr-includes (= 1.59.0)
9+
- boost/string_algorithms-includes (= 1.59.0)
10+
- boost/graph-includes (1.59.0)
11+
- boost/math-includes (1.59.0)
12+
- boost/numeric-includes (1.59.0)
13+
- boost/pointer_cast-includes (1.59.0)
14+
- boost/preprocessor-includes (1.59.0)
15+
- boost/shared_ptr-includes (1.59.0)
16+
- boost/string_algorithms-includes (1.59.0)
17+
- DoubleConversion (1.1.5)
18+
- Folly (2016.09.26.00):
19+
- boost
20+
- DoubleConversion
21+
- GLog
22+
- GLog (0.3.4)
23+
- native-navigation (0.2.2):
324
- React
4-
- React (0.42.3):
5-
- React/Core (= 0.42.3)
6-
- React/Core (0.42.3):
25+
- React (0.50.4):
26+
- React/Core (= 0.50.4)
27+
- React/Core (0.50.4):
28+
- yoga (= 0.50.4.React)
29+
- React/CxxBridge (0.50.4):
30+
- Folly (= 2016.09.26.00)
31+
- React/Core
732
- React/cxxreact
8-
- Yoga (= 0.42.3.React)
9-
- React/cxxreact (0.42.3):
33+
- React/cxxreact (0.50.4):
34+
- boost
35+
- Folly (= 2016.09.26.00)
1036
- React/jschelpers
11-
- React/jschelpers (0.42.3)
12-
- React/RCTAnimation (0.42.3):
37+
- React/DevSupport (0.50.4):
38+
- React/Core
39+
- React/RCTWebSocket
40+
- React/fishhook (0.50.4)
41+
- React/jschelpers (0.50.4):
42+
- Folly (= 2016.09.26.00)
43+
- React/PrivateDatabase
44+
- React/PrivateDatabase (0.50.4)
45+
- React/RCTAnimation (0.50.4):
46+
- React/Core
47+
- React/RCTBlob (0.50.4):
1348
- React/Core
14-
- React/RCTImage (0.42.3):
49+
- React/RCTImage (0.50.4):
1550
- React/Core
1651
- React/RCTNetwork
17-
- React/RCTNetwork (0.42.3):
52+
- React/RCTNetwork (0.50.4):
1853
- React/Core
19-
- React/RCTText (0.42.3):
54+
- React/RCTText (0.50.4):
2055
- React/Core
21-
- React/RCTWebSocket (0.42.3):
56+
- React/RCTWebSocket (0.50.4):
2257
- React/Core
23-
- Yoga (0.42.3.React)
58+
- React/fishhook
59+
- React/RCTBlob
60+
- yoga (0.50.4.React)
2461

2562
DEPENDENCIES:
63+
- DoubleConversion (from `../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
64+
- Folly (from `../../node_modules/react-native/third-party-podspecs/Folly.podspec`)
65+
- GLog (from `../../node_modules/react-native/third-party-podspecs/GLog.podspec`)
2666
- native-navigation (from `../../`)
2767
- React/Core (from `../../node_modules/react-native`)
68+
- React/CxxBridge (from `../../node_modules/react-native`)
69+
- React/DevSupport (from `../../node_modules/react-native`)
2870
- React/RCTAnimation (from `../../node_modules/react-native`)
2971
- React/RCTImage (from `../../node_modules/react-native`)
3072
- React/RCTNetwork (from `../../node_modules/react-native`)
3173
- React/RCTText (from `../../node_modules/react-native`)
3274
- React/RCTWebSocket (from `../../node_modules/react-native`)
33-
- Yoga (from `../../node_modules/react-native/ReactCommon/yoga/Yoga.podspec`)
75+
- yoga (from `../../node_modules/react-native/ReactCommon/yoga/yoga.podspec`)
3476

3577
EXTERNAL SOURCES:
78+
DoubleConversion:
79+
:podspec: ../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec
80+
Folly:
81+
:podspec: ../../node_modules/react-native/third-party-podspecs/Folly.podspec
82+
GLog:
83+
:podspec: ../../node_modules/react-native/third-party-podspecs/GLog.podspec
3684
native-navigation:
37-
:path: "../../"
85+
:path: ../../
3886
React:
39-
:path: "../../node_modules/react-native"
40-
Yoga:
41-
:path: "../../node_modules/react-native/ReactCommon/yoga/Yoga.podspec"
87+
:path: ../../node_modules/react-native
88+
yoga:
89+
:path: ../../node_modules/react-native/ReactCommon/yoga/yoga.podspec
4290

4391
SPEC CHECKSUMS:
44-
native-navigation: 23b0ef13de8bd9aaa4dbaa115e9b7055e6844987
45-
React: 35e039680feacd0563677d49ba410112d2748559
46-
Yoga: 86ce777665c8259b94ef8dbea76b84634237f4ea
92+
boost: 30a15ffb6d9aa4646dd3caffc960753f4cb4ca4e
93+
DoubleConversion: ebb6747c5b66026ad4f97b789c3ceac6f18e57a6
94+
Folly: b7255b29f1d693c375d642d0f04f0592181156d9
95+
GLog: 3e4e4ae9746ce6bf6e9420c7fc1e08ad59c8ba1a
96+
native-navigation: 0ebd8a62e3bee892e345f6bc0ccc29a30a4e211b
97+
React: 6d7efef18e0241eb832cf4c085405169a15080ed
98+
yoga: b9aebf996711e50fc31f5608c10aa108a5a0c29e
4799

48-
PODFILE CHECKSUM: 62780c26b71f717952c8247c70052484dc91c6b3
100+
PODFILE CHECKSUM: 2fb86f88c222dc5cebd1e277c564850e039b1ab6
49101

50-
COCOAPODS: 1.2.0
102+
COCOAPODS: 1.3.1

example/ios/native-navigation.xcodeproj/project.pbxproj

+17-1
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,22 @@
170170
files = (
171171
);
172172
inputPaths = (
173+
"${SRCROOT}/Pods/Target Support Files/Pods-native-navigation/Pods-native-navigation-frameworks.sh",
174+
"${BUILT_PRODUCTS_DIR}/DoubleConversion/DoubleConversion.framework",
175+
"${BUILT_PRODUCTS_DIR}/Folly/folly.framework",
176+
"${BUILT_PRODUCTS_DIR}/GLog/glog.framework",
177+
"${BUILT_PRODUCTS_DIR}/React/React.framework",
178+
"${BUILT_PRODUCTS_DIR}/native-navigation/NativeNavigation.framework",
179+
"${BUILT_PRODUCTS_DIR}/yoga/yoga.framework",
173180
);
174181
name = "[CP] Embed Pods Frameworks";
175182
outputPaths = (
183+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DoubleConversion.framework",
184+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/folly.framework",
185+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework",
186+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/React.framework",
187+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NativeNavigation.framework",
188+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/yoga.framework",
176189
);
177190
runOnlyForDeploymentPostprocessing = 0;
178191
shellPath = /bin/sh;
@@ -185,13 +198,16 @@
185198
files = (
186199
);
187200
inputPaths = (
201+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
202+
"${PODS_ROOT}/Manifest.lock",
188203
);
189204
name = "[CP] Check Pods Manifest.lock";
190205
outputPaths = (
206+
"$(DERIVED_FILE_DIR)/Pods-native-navigation-checkManifestLockResult.txt",
191207
);
192208
runOnlyForDeploymentPostprocessing = 0;
193209
shellPath = /bin/sh;
194-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
210+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
195211
showEnvVarsInLog = 0;
196212
};
197213
B6D02C1952665A05D8ABE50D /* [CP] Copy Pods Resources */ = {

example/ios/native-navigation/Images.xcassets/AppIcon.appiconset/Contents.json

+5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
"idiom" : "iphone",
4040
"size" : "60x60",
4141
"scale" : "3x"
42+
},
43+
{
44+
"idiom" : "ios-marketing",
45+
"size" : "1024x1024",
46+
"scale" : "1x"
4247
}
4348
],
4449
"info" : {

example/screens/NavigationBar.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { Component, PropTypes } from 'react';
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
23
import { Dimensions } from 'react-native';
34

45
import Navigator from 'native-navigation';

lib/ios/native-navigation/Dictionary+FunctionalExtensions.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ extension Dictionary {
4040
return dict
4141
}
4242

43-
43+
#if swift(>=3.2)
44+
#else
4445
public func mapValues<OutValue>(transform: (Value) throws -> OutValue) rethrows -> [Key: OutValue] {
4546
var dict = [Key: OutValue]()
4647
for (key, value) in self {
4748
dict[key] = try transform(value)
4849
}
4950
return dict
5051
}
52+
#endif
5153
}

lib/ios/native-navigation/SharedElementGroupManager.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ final class SharedElementGroupManager: RCTViewManager {
4646
return SharedElementGroup()
4747
}
4848

49-
override func constantsToExport() -> [String: Any] {
49+
override func constantsToExport() -> [AnyHashable: Any] {
5050
return [
5151
"VERSION": VERSION
5252
]

lib/ios/native-navigation/SharedElementManager.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ final class SharedElementManager: RCTViewManager {
5353
return SharedElement()
5454
}
5555

56-
override func constantsToExport() -> [String: Any] {
56+
override func constantsToExport() -> [AnyHashable: Any] {
5757
return [
5858
"VERSION": VERSION
5959
]

lib/ios/native-navigation/TabBarViewManager.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ final class TabBarViewManager: RCTViewManager {
4545
return TabBar()
4646
}
4747

48-
override func constantsToExport() -> [String: Any] {
48+
override func constantsToExport() -> [AnyHashable: Any] {
4949
return [
5050
"VERSION": VERSION
5151
]

lib/ios/native-navigation/TabViewManager.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ final class TabViewManager: RCTViewManager {
8181
// return TabView(implementation: ReactNavigationCoordinator.sharedInstance.navigation)
8282
}
8383

84-
override func constantsToExport() -> [String: Any] {
84+
override func constantsToExport() -> [AnyHashable: Any] {
8585
return [
8686
"VERSION": VERSION
8787
]

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "native-navigation",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"description": "Native Navigation for React Native",
55
"main": "index.js",
66
"scripts": {
7+
"postinstall":"sh postinstall.sh",
78
"start": "node node_modules/react-native/local-cli/cli.js start",
89
"run:packager": "./node_modules/react-native/packager/packager.sh",
910
"run:ios": "react-native run-ios --project-path ./example/ios",
@@ -37,8 +38,8 @@
3738
},
3839
"homepage": "https://github.com/airbnb/native-navigation#readme",
3940
"peerDependencies": {
40-
"react": ">=15.3.1",
41-
"react-native": ">=0.42"
41+
"react": ">=16.0.0",
42+
"react-native": ">=0.50"
4243
},
4344
"dependencies": {
4445
"prop-types": "^15.5.10",
@@ -58,8 +59,8 @@
5859
"eslint-plugin-react": "^6.1.2",
5960
"gitbook-cli": "^2.3.0",
6061
"murmur2js": "^1.0.0",
61-
"react": "^15.4.1",
62-
"react-native": "^0.42.3"
62+
"react": "^16.1.1",
63+
"react-native": "^0.50.4"
6364
},
6465
"rnpm": {
6566
"android": {

postinstall.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
echo 'hacking...'
2+
sed -i '' 's/\#import <RCTAnimation\/RCTValueAnimatedNode.h>/\#import \"RCTValueAnimatedNode.h\"/' ./node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h
3+
sed -i '' 's/\#import <fishhook\/fishhook.h>/\#import <React\/fishhook.h>/' ./node_modules/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.m
4+
echo 'hacked'

0 commit comments

Comments
 (0)