62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
@implementation AboutController
- (void)viewDidLoad
{
[super viewDidLoad];
self.automaticallyAdjustsScrollViewInsets = NO;
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
NSString *version = infoDictionary[@"CFBundleShortVersionString"];
NSString *aboutHTML = [aboutHTMLTemplate
stringByReplacingOccurrencesOfString: @"{version}"
withString: version];
[self.webView loadHTMLString: aboutHTML
baseURL: nil];
}
- (void)dealloc
{
[_webView release];
[super dealloc];
}
- (BOOL)webView: (UIWebView *)webView
shouldStartLoadWithRequest: (NSURLRequest *)request
navigationType: (UIWebViewNavigationType)navigationType
{
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
[[UIApplication sharedApplication] openURL: request.URL
options: @{}
completionHandler: ^ (BOOL success) {
}];
return NO;
}
return YES;
}
@end
|
|
|
|
|
|
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
@implementation AboutController
- (void)viewDidLoad
{
[super viewDidLoad];
self.automaticallyAdjustsScrollViewInsets = NO;
NSDictionary *infoDictionary = NSBundle.mainBundle.infoDictionary;
NSString *version = infoDictionary[@"CFBundleShortVersionString"];
NSString *aboutHTML = [aboutHTMLTemplate
stringByReplacingOccurrencesOfString: @"{version}"
withString: version];
[self.webView loadHTMLString: aboutHTML
baseURL: nil];
}
- (void)dealloc
{
[_webView release];
[super dealloc];
}
- (BOOL)webView: (UIWebView *)webView
shouldStartLoadWithRequest: (NSURLRequest *)request
navigationType: (UIWebViewNavigationType)navigationType
{
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
[UIApplication.sharedApplication openURL: request.URL
options: @{}
completionHandler: ^ (BOOL success) {
}];
return NO;
}
return YES;
}
@end
|