在异步模式下完成下载时,MBProgressHud触摸事件响应缓慢

时间:2015-01-18 18:23:51

标签: ios objective-c nsurl mbprogresshud

我有以下代码

-(void)singleTap:(UITapGestureRecognizer*)sender
{
  NSLog(@"%@",@"tapped");

  [self setDownLoadLabel:[SAGlobal stringForValue:@"CANCELLINGDOWNLOAD"] withSubHeading:@""];
  SharedAppDelegatee.downLoadCancelFlag=YES;
  [self.downloadManager cancelAll];
  [self.downLoadHud hide:YES];
  [self downLoadButtonStatusSetter];
}

-(void) startFileDownLoadingWithHUD
{
  self.downLoadHud=[MBProgressHUD showHUDAddedTo:[SharedAppDelegate window] animated:YES];
   //  self.downLoadHud=[MBProgressHUD showHUDAddedTo:self.view animated:YES];

  self.downLoadHud.mode = MBProgressHUDModeIndeterminate;
  UITapGestureRecognizer *HUDSingleTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(singleTap:)];
  [self.downLoadHud addGestureRecognizer:HUDSingleTap];
  [self setDownLoadLabel:@"Initializing..." withSubHeading:@""];
  //self.downLoadHud.labelText = @"Initiali";
  //self.downLoadHud.detailsLabelText =@"";
  [self.downLoadHud setColor:[UIColor blackColor]];
  [self startDownLoadFilesSerially];

}

enter image description here

MBProgress点击手势响应缓慢。花了一些时间来执行" tapped"事件。触摸hud后,执行NSLog需要10秒钟(@"%@",@"轻拍"); 使用以下库完成下载。

https://github.com/robertmryan/download-manager

有没有其他方法可以捕获MBProgressHUD中的触摸事件?可能的替代方案?

0 个答案:

没有答案