-
Notifications
You must be signed in to change notification settings - Fork 0
/
webview.m
61 lines (42 loc) · 1.59 KB
/
webview.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
59
60
//
// webview.m
// hyscoswift
//
// Created by Joas Scicchitano on 10/12/14.
// Copyright (c) 2014 ___informaticamilano___. All rights reserved.
//
#import "webview.h"
@interface webview ()
@property (strong, nonatomic) UIWebView *hsycoview;
@end
@implementation webview
- (void)viewDidLoad {
[super viewDidLoad];
NSString *urlString = [[NSUserDefaults standardUserDefaults]
stringForKey:@"urlremoto"];
NSURL *url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
//[NSURL URLWithString:@"https://office.hsyco.net/hschschsc/office"];
// request load with cache
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:15.0];
// Define webframe with autosize and rotation, width/height
self.hsycoview = [[UIWebView alloc] initWithFrame:self.view.bounds];
self.hsycoview.scalesPageToFit = YES;
self.hsycoview.frame = CGRectMake(0, 0, 1024, 768);
self.hsycoview.autoresizesSubviews = YES;
self.hsycoview.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
[self.view addSubview:self.hsycoview];
[self.hsycoview loadRequest:theRequest];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
#if DEBUG
@implementation NSURLRequest (NSURLRequestWithIgnoreSSL)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
{
return YES;
}
@end
#endif