-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathViewController.m
58 lines (44 loc) · 1.46 KB
/
ViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// ViewController.m
// TestApp
//
// Created by Bhargav Nookala on 8/26/15.
// Copyright (c) 2015 Bhargav Nookala. All rights reserved.
//
#import "ViewController.h"
#import "ViewControllerBridge.h"
#import "MyReactView.h"
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self.view addSubview:self.reactView];
[self.view addSubview:self.myButton];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (ReactView *)reactView {
if (_reactView == nil) {
_reactView = [[MyReactView alloc]
initWithFrame:CGRectMake(0, 10, 320, 480)
viewController:self
bridgeModule:[ViewControllerBridge bridgeName]];
}
return _reactView;
}
- (UIButton *)myButton {
if (_myButton == nil) {
_myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
_myButton.frame = CGRectMake(0, 270, 320, 40);
[_myButton setTitle:@"Hide the react view." forState:UIControlStateNormal];
[_myButton addTarget:self action:@selector(dismissViaNativeControl) forControlEvents:UIControlEventTouchUpInside];
}
return _myButton;
}
- (void)dismissViaNativeControl {
NSLog(@"Hiding the react view via native IOS control.");
self.reactView.hidden = !self.reactView.isHidden;
}
@end