Commit d00ab602400133796b6350efdc2b731ee1d02702

Authored by yanglingyu
1 parent 01f8ba47

防连点操作遗漏问题处理

CNLiveScioLive/Pages/Tools/Category/UINavigationController+PushOneVC.m
@@ -23,9 +23,12 @@ @@ -23,9 +23,12 @@
23 -(void)CN_pushViewController:(UIViewController *)viewController animated:(BOOL)animated 23 -(void)CN_pushViewController:(UIViewController *)viewController animated:(BOOL)animated
24 { 24 {
25 if ([self.viewControllers.lastObject isKindOfClass:[viewController class]]) { 25 if ([self.viewControllers.lastObject isKindOfClass:[viewController class]]) {
26 - return;  
27 - } 26 + NSMutableArray *controllersAry = [NSMutableArray arrayWithArray:self.viewControllers];
  27 + [controllersAry replaceObjectAtIndex:self.viewControllers.count-1 withObject:viewController];
  28 + [self setViewControllers:controllersAry animated:YES];
  29 + }else{
28 self.modalPresentationStyle = UIModalPresentationFullScreen; 30 self.modalPresentationStyle = UIModalPresentationFullScreen;
29 [self CN_pushViewController:viewController animated:YES]; 31 [self CN_pushViewController:viewController animated:YES];
  32 + }
30 } 33 }
31 @end 34 @end