// // HelpViewController.m // TumblrDownloader // // Created by HonorLee on 16/1/17. // Copyright © 2016年 HonorLee. All rights reserved. // #import "HelpViewController.h" #import "Helper.h" @interface HelpViewController () @end @implementation HelpViewController MBProgressHUD *HUD; - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. _JumpToTumblr.layer.borderColor = [[UIColor whiteColor]CGColor]; _JumpToTumblr.layer.borderWidth = 1; _JumpToTumblr.layer.cornerRadius = 5.0f; [_JumpToTumblr setTitle:NSLocalizedString(@"OpenTumblrBtnText", nil) forState:UIControlStateNormal]; // _JumpToTumblr.titleLabel.text = NSLocalizedString(@"OpenTumblrBtnText", nil); _HelpTextView.text = NSLocalizedString(@"HelpText", nil); [_HelpTextView setTextColor:[UIColor whiteColor]]; [_HelpTextView setFont:[UIFont fontWithName:@"Helvetica Neue" size:16.0]]; HUD = [[MBProgressHUD alloc] initWithView:self.view]; HUD.mode = MBProgressHUDModeText; HUD.removeFromSuperViewOnHide = NO; HUD.yOffset = self.view.frame.size.height/2-200; [self.view addSubview:HUD]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } -(void)viewDidDisappear:(BOOL)animated{ [Helper changeStatusBarBackground:[UIColor whiteColor]]; [self.tabBarController.tabBar setBarTintColor:[UIColor whiteColor]]; } -(void)viewDidAppear:(BOOL)animated{ [Helper changeStatusBarBackground:[UIColor colorWithRed:0 green:191/255.0 blue:1 alpha:1]]; [self.tabBarController.tabBar setBarTintColor:[UIColor colorWithRed:0 green:191/255.0 blue:1 alpha:1]]; } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ - (IBAction)ButtonOnPress:(id)sender { _JumpToTumblr.alpha = 0.5f; } - (IBAction)ButtonOnOff:(id)sender { _JumpToTumblr.alpha = 1.0f; if ([[UIApplication sharedApplication]canOpenURL:[NSURL URLWithString:@"tumblr://"]]){ HUD.labelText = NSLocalizedString(@"OpenTumblrSuccess", nil); [HUD show:YES]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tumblr://"]]; }else{ HUD.labelText = NSLocalizedString(@"OpenTumblrError", nil); [HUD show:YES]; } dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 2.0*NSEC_PER_SEC); dispatch_after(popTime, dispatch_get_main_queue(), ^{ [HUD hide:YES]; }); } - (IBAction)ButtonOnCancel:(id)sender { _JumpToTumblr.alpha = 1.0f; } @end