Commit 01f8ba479a3a0081db579a238449559e9b232d14

Authored by yanglingyu
1 parent e2ad1b6b

修复重复跳转bug

CNLiveScioLive.xcodeproj/project.pbxproj
... ... @@ -53,6 +53,7 @@
53 53 0838487D215CF6FC00186618 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0838487C215CF6FB00186618 /* BaseViewController.m */; };
54 54 0838487E215CF6FC00186618 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0838487C215CF6FB00186618 /* BaseViewController.m */; };
55 55 0838487F215CF6FC00186618 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0838487C215CF6FB00186618 /* BaseViewController.m */; };
  56 + 083CB9C926D8CF6100E21EBC /* UINavigationController+PushOneVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 083CB9C826D8CF6100E21EBC /* UINavigationController+PushOneVC.m */; };
56 57 08471A9F25E7864E0043FC2D /* VideoDetailPresent.m in Sources */ = {isa = PBXBuildFile; fileRef = 08471A9E25E7864E0043FC2D /* VideoDetailPresent.m */; };
57 58 084ACDFD21547AE80089E035 /* CNLiveContactUsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACDFC21547AE80089E035 /* CNLiveContactUsViewController.m */; };
58 59 084ACDFE21547AE80089E035 /* CNLiveContactUsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 084ACDFC21547AE80089E035 /* CNLiveContactUsViewController.m */; };
... ... @@ -659,6 +660,8 @@
659 660 08384877215CC9E400186618 /* GraphicLiveViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicLiveViewController.h; sourceTree = "<group>"; };
660 661 0838487B215CF6FB00186618 /* BaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = "<group>"; };
661 662 0838487C215CF6FB00186618 /* BaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = "<group>"; };
  663 + 083CB9C726D8CF6100E21EBC /* UINavigationController+PushOneVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UINavigationController+PushOneVC.h"; sourceTree = "<group>"; };
  664 + 083CB9C826D8CF6100E21EBC /* UINavigationController+PushOneVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UINavigationController+PushOneVC.m"; sourceTree = "<group>"; };
662 665 08471A9D25E7864E0043FC2D /* VideoDetailPresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VideoDetailPresent.h; sourceTree = "<group>"; };
663 666 08471A9E25E7864E0043FC2D /* VideoDetailPresent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VideoDetailPresent.m; sourceTree = "<group>"; };
664 667 084ACDFB21547AE80089E035 /* CNLiveContactUsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveContactUsViewController.h; sourceTree = "<group>"; };
... ... @@ -1877,6 +1880,8 @@
1877 1880 08C090862150C96C00E23D16 /* UIView+Extension.m */,
1878 1881 08940D732154EB2C00F85DB6 /* UILabel+TextAlign.h */,
1879 1882 08940D742154EB2C00F85DB6 /* UILabel+TextAlign.m */,
  1883 + 083CB9C726D8CF6100E21EBC /* UINavigationController+PushOneVC.h */,
  1884 + 083CB9C826D8CF6100E21EBC /* UINavigationController+PushOneVC.m */,
1880 1885 );
1881 1886 path = Category;
1882 1887 sourceTree = "<group>";
... ... @@ -2707,6 +2712,7 @@
2707 2712 08C721BE24CAC9B700970100 /* TAAnimatedDotView.m in Sources */,
2708 2713 0838487D215CF6FC00186618 /* BaseViewController.m in Sources */,
2709 2714 C3004D35215A583400A83C3D /* CNLiveNewsDetailsView.m in Sources */,
  2715 + 083CB9C926D8CF6100E21EBC /* UINavigationController+PushOneVC.m in Sources */,
2710 2716 08C721BA24CAC9B700970100 /* UIView+SDExtension.m in Sources */,
2711 2717 0816B5E42648C23A005E1F8C /* UIColor+CNGray.m in Sources */,
2712 2718 );
... ...
CNLiveScioLive/Pages/Live/Controller/CNLiveViewController.m
... ... @@ -62,12 +62,12 @@ static NSString *indicatorTableViewCell = @&quot;CNLiveIndicatorTableViewCell&quot;;
62 62 // self->_isLoaded = YES;
63 63  
64 64 } failure:^(NSError *error) {
  65 + [MBProgressHUD hideHUDForView:self.view animated:YES];
65 66 NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"LiveHeader"];
66 67 if (data) {
67 68 [self dealDictionaryData:data];
68 69 }
69 70 [AlertViewTool showHUDAddedToView:self.view text:CustomStr(@"ServerBusy")];
70   - [MBProgressHUD hideHUDForView:self.view animated:YES];
71 71  
72 72 }];
73 73 }
... ...
CNLiveScioLive/Pages/Live/Controller/GraphicLiveViewController.m
... ... @@ -197,6 +197,7 @@
197 197 [shareButton addTarget:self action:@selector(shareButton:) forControlEvents:UIControlEventTouchUpInside];
198 198 [shareButton setImage:[UIImage imageNamed:@"cnlive_live_share"] forState:UIControlStateNormal];
199 199 [shareButton setFrame:CGRectMake(MainScreenWidth-40, StatusBarHeight+7, 30, 30)];
  200 + shareButton.centerY = backButton.centerY;
200 201 [self.view addSubview:shareButton];
201 202  
202 203 }
... ... @@ -232,6 +233,7 @@
232 233 [shareButton addTarget:self action:@selector(shareButton:) forControlEvents:UIControlEventTouchUpInside];
233 234 [shareButton setImage:[UIImage imageNamed:@"cnlive_live_share"] forState:UIControlStateNormal];
234 235 [shareButton setFrame:CGRectMake(MainScreenWidth-40, StatusBarHeight+7, 30, 30)];
  236 + shareButton.centerY = backButton.centerY;
235 237 [bgView addSubview:shareButton];
236 238  
237 239 if (self.type == PlayerTypeLiving) {
... ...
CNLiveScioLive/Pages/Tools/Category/UINavigationController+PushOneVC.h 0 → 100644
  1 +//
  2 +// UINavigationController+PushOneVC.h
  3 +// CNLiveScioLive
  4 +//
  5 +// Created by CNLive on 2021/8/27.
  6 +// Copyright © 2021 CNLive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +@interface UINavigationController (PushOneVC)
  14 +
  15 +@end
  16 +
  17 +NS_ASSUME_NONNULL_END
... ...
CNLiveScioLive/Pages/Tools/Category/UINavigationController+PushOneVC.m 0 → 100644
  1 +//
  2 +// UINavigationController+PushOneVC.m
  3 +// CNLiveScioLive
  4 +//
  5 +// Created by CNLive on 2021/8/27.
  6 +// Copyright © 2021 CNLive. All rights reserved.
  7 +//
  8 +
  9 +#import "UINavigationController+PushOneVC.h"
  10 +#import <objc/runtime.h>
  11 +
  12 +@implementation UINavigationController (PushOneVC)
  13 ++(void)load
  14 +{
  15 + static dispatch_once_t onceToken;
  16 + dispatch_once(&onceToken, ^{
  17 + Method origin = class_getInstanceMethod(self, @selector(pushViewController:animated:));
  18 + Method new = class_getInstanceMethod(self, @selector(CN_pushViewController:animated:));
  19 + method_exchangeImplementations(origin, new);
  20 + });
  21 +}
  22 +
  23 +-(void)CN_pushViewController:(UIViewController *)viewController animated:(BOOL)animated
  24 +{
  25 + if ([self.viewControllers.lastObject isKindOfClass:[viewController class]]) {
  26 + return;
  27 + }
  28 + self.modalPresentationStyle = UIModalPresentationFullScreen;
  29 + [self CN_pushViewController:viewController animated:YES];
  30 +}
  31 +@end
... ...