forked from wfxiaolong/STWebViewController
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewController.m
More file actions
43 lines (32 loc) · 1.08 KB
/
ViewController.m
File metadata and controls
43 lines (32 loc) · 1.08 KB
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
//
// ViewController.m
// STWebViewController
//
// Created by linxiaolong on 15/4/27.
// Copyright (c) 2015年 linxiaolong. All rights reserved.
//
#import "ViewController.h"
#import "STWebViewController.h"
#define URLSTRING @"https://www.jd.com/"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
CGRect rect = {{50, 100},{200, 50}};
UIButton *btn = [[UIButton alloc] initWithFrame:rect];
[btn setTitle:@"Left Swipe Page" forState:UIControlStateNormal];
btn.backgroundColor = [UIColor blackColor];
[btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)btnClick:(id)sender {
STWebViewController *webC = [[STWebViewController alloc] initWithAddress:URLSTRING];
[self.navigationController pushViewController:webC animated:YES];
}
@end