-
Notifications
You must be signed in to change notification settings - Fork 0
/
ViewController.m
52 lines (40 loc) · 1.29 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
//
// ViewController.m
// TestVPNConfig
//
// Created by Hepburn on 2018/3/22.
// Copyright © 2018年 Hepburn. All rights reserved.
//
#import "ViewController.h"
#import <NetworkExtension/NetworkExtension.h>
#import "ConfigVPN.h"
@interface ViewController ()
{
UIWebView *mWebView;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
mWebView = [[UIWebView alloc] initWithFrame:self.view.bounds];
mWebView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
[self.view addSubview:mWebView];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(50, 50, 150, 50);
btn.backgroundColor = [UIColor blueColor];
[btn setTitle:@"Google" forState:UIControlStateNormal];
[btn addTarget:self action:@selector(OnButtonClick) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];
[[ConfigVPN shareManager] connectVPN];
//[self OnButtonClick];
}
- (void)OnButtonClick
{
NSString *urlstr = @"https://www.google.com";
[mWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlstr]]];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end