VLCAboutViewController.m 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // VLCAboutViewController.m
  3. // AspenProject
  4. //
  5. // Created by Felix Paul Kühne on 07.04.13.
  6. // Copyright (c) 2013 VideoLAN. All rights reserved.
  7. //
  8. // Refer to the COPYING file of the official project for license.
  9. //
  10. #import "VLCAboutViewController.h"
  11. #import "UIBarButtonItem+Theme.h"
  12. @implementation VLCAboutViewController
  13. - (void)viewDidLoad
  14. {
  15. [super viewDidLoad];
  16. self.navigationItem.title = NSLocalizedString(@"ABOUT_APP", @"");
  17. [self.webView loadHTMLString:[NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"About Contents" ofType:@"html"] encoding:NSUTF8StringEncoding error:nil] baseURL:nil];
  18. self.webView.delegate = self;
  19. self.aspenVersion.text = [[NSString stringWithFormat:NSLocalizedString(@"VERSION_FORMAT",@""), [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]] stringByAppendingFormat:@" %@", kVLCVersionCodename];
  20. self.vlckitVersion.text = [NSString stringWithFormat:NSLocalizedString(@"BASED_ON_FORMAT",@""),[[VLCLibrary sharedLibrary] version]];
  21. }
  22. - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
  23. {
  24. NSURL *requestURL = request.URL;
  25. if (![requestURL.scheme isEqualToString:@""])
  26. return ![[UIApplication sharedApplication] openURL:requestURL];
  27. else
  28. return YES;
  29. }
  30. - (void)webViewDidFinishLoad:(UIWebView *)webView
  31. {
  32. webView.alpha = 0.;
  33. CGFloat alpha = 1.;
  34. void (^animationBlock)() = ^() {
  35. webView.alpha = alpha;
  36. };
  37. void (^completionBlock)(BOOL finished) = ^(BOOL finished) {
  38. webView.hidden = NO;
  39. };
  40. [UIView animateWithDuration:1. animations:animationBlock completion:completionBlock];
  41. }
  42. @end