This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var route: String? | |
// in viewDidLoad | |
self.reactViewWrapper.data = [ | |
“route”: self.route!, | |
“content”: “Welcome to React Native” | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ReactNativeObjCViewController.h | |
@property (strong, nonatomic) NSString *route; | |
// ReactNativeObjCViewController.m | |
self.reactViewWrapper.data = [@{ | |
@"route": self.route, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)reactViewObjCPressed:(id)sender { | |
ReactNativeObjCViewController *reactNativeVC = [self.storyboard instantiateViewControllerWithIdentifier:@"ReactNativeObjCVC"]; | |
reactNativeVC.route = @"routeNameObjectiveCView"; | |
[self.navigationController pushViewController:reactNativeVC animated:YES]; | |
} | |
- (IBAction)reactViewSwiftPressed:(id)sender { | |
ReactNativeSwiftViewController *reactNativeVC = [self.storyboard instantiateViewControllerWithIdentifier:@"ReactNativeSwiftVC"]; | |
reactNativeVC.route = @"routeNameSwiftView"; | |
[self.navigationController pushViewController:reactNativeVC animated:YES]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ReactNativeObjCViewController.h | |
@property (strong, nonatomic) NSString *route; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import React from 'react-native'; | |
// Views | |
import SwiftView from './Views/SwiftView'; | |
import ObjectiveCView from './Views/ObjectiveCView'; | |
const { | |
AppRegistry, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import React from 'react-native'; | |
const { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
View | |
} = React; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ReactNativeSwiftViewController.swift | |
// | |
import UIKit | |
class ReactNativeSwiftViewController: UIViewController { | |
@IBOutlet weak var reactViewWrapper: ReactNativeViewSwift! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ReactNativeObjCViewController.m | |
// | |
#import "ReactNativeObjCViewController.h" | |
#import "ReactNativeViewObjC.h" | |
@interface ReactNativeObjCViewController () | |
@property (weak, nonatomic) IBOutlet ReactNativeViewObjC *reactViewWrapper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ReactNativeObjCViewController.h | |
// | |
#import <UIKit/UIKit.h> | |
@interface ReactNativeObjCViewController : UIViewController | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ReactNativeViewSwift.swift | |
// | |
import UIKit | |
class ReactNativeViewSwift: UIView { | |
var data: [String: AnyObject]? |
NewerOlder