@@ -93,10 +93,17 @@ type Event = Object;
9393 */
9494
9595/**
96- * `NavigatorIOS` is a wrapper around UIKit navigation, enabling you to
97- * implement back-swipe functionality in your iOS app. Take a look at
96+ * `NavigatorIOS` is a wrapper around
97+ * [`UINavigationController`](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UINavigationController_Class/),
98+ * enabling you to implement a navigation stack. It works exactly the same as it
99+ * would on a native app using `UINavigationController`, providing the same
100+ * animations and behavior from UIKIt.
101+ *
102+ * As the name implies, it is only available on iOS. Take a look at
98103 * [`Navigator`](/docs/navigator.html) for a similar solution for your
99- * cross-platform needs.
104+ * cross-platform needs, or check out
105+ * [react-native-navigation](https://github.com/wix/react-native-navigation), a
106+ * component that aims to provide native navigation on both iOS and Android.
100107 *
101108 * To set up the navigator, provide the `initialRoute` prop with a route
102109 * object. A route object is used to describe each scene that your app
@@ -106,53 +113,68 @@ type Event = Object;
106113 * import React, { Component } from 'react';
107114 * import { NavigatorIOS, Text } from 'react-native';
108115 *
109- * class NavvyIOS extends Component {
116+ * export default class NavigatorIOSApp extends Component {
110117 * render() {
111118 * return (
112119 * <NavigatorIOS
113120 * initialRoute={{
114- * component: MyView ,
115- * title: 'My View Title ',
121+ * component: MyScene ,
122+ * title: 'My Initial Scene ',
116123 * }}
117124 * style={{flex: 1}}
118125 * />
119126 * );
120127 * }
121128 * }
122129 *
123- * class MyView extends Component {
130+ * class MyScene extends Component {
131+ * static propTypes = {
132+ * title: PropTypes.string.isRequired,
133+ * navigator: PropTypes.object.isRequired,
134+ * }
135+ *
136+ * constructor(props, context) {
137+ * super(props, context);
138+ * this._onForward = this._onForward.bind(this);
139+ * this._onBack = this._onBack.bind(this);
140+ * }
141+ *
142+ * _onForward() {
143+ * this.props.navigator.push({
144+ * title: 'Scene ' + nextIndex,
145+ * });
146+ * }
147+ *
124148 * render() {
125- * return(
126- * <Text style={{marginTop: 200, alignSelf: 'center'}}>
127- * See you on the other nav!
128- * </Text>
129- * );
149+ * return (
150+ * <View>
151+ * <Text>Current Scene: { this.props.title }</Text>
152+ * <TouchableHighlight onPress={this._onForward}>
153+ * <Text>Tap me to load the next scene</Text>
154+ * </TouchableHighlight>
155+ * </View>
156+ * )
130157 * }
131158 * }
132159 * ```
133160 *
134- * In this code, the navigator sets its title and renders `MyView`. The
135- * component specified in `initialRoute` will receive a `route` prop and a
136- * `navigator` prop representing the navigator.
161+ * In this code, the navigator renders the component specified in initialRoute,
162+ * which in this case is `MyScene`. This component will receive a `route` prop
163+ * and a `navigator` prop representing the navigator. The navigator's navigation
164+ * bar will render the title for the current scene, "My Initial Scene".
137165 *
138166 * You can optionally pass in a `passProps` property to your `initialRoute`.
139167 * `NavigatorIOS` passes this in as props to the rendered component:
140168 *
141169 * ```
142170 * initialRoute={{
143- * component: MyView ,
144- * title: 'Foo This ',
171+ * component: MyScene ,
172+ * title: 'My Initial Scene ',
145173 * passProps: { myProp: 'foo' }
146174 * }}
147175 * ```
148176 *
149- * You can then access the props passed in:
150- *
151- * ```
152- * <Text style={{marginTop: 200, alignSelf: 'center'}}>
153- * See you on the other nav {this.props.myProp}!
154- * </Text>
155- * ```
177+ * You can then access the props passed in via `{this.props.myProp}`.
156178 *
157179 * #### Handling Navigation
158180 *
@@ -254,6 +276,7 @@ type Event = Object;
254276 *
255277 * In the example above the navigation bar color is changed when the new route
256278 * is pushed.
279+ *
257280 */
258281var NavigatorIOS = React . createClass ( {
259282
0 commit comments