我有以下代码
-(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];
}
MBProgress点击手势响应缓慢。花了一些时间来执行" tapped"事件。触摸hud后,执行NSLog需要10秒钟(@"%@",@"轻拍"); 使用以下库完成下载。
https://github.com/robertmryan/download-manager
有没有其他方法可以捕获MBProgressHUD中的触摸事件?可能的替代方案?