Commit eb723e6a619e29b342e63c0f29c45ad5feee9565
1 parent
4bd6e7ad
no message
Showing
7 changed files
with
1 additions
and
265 deletions
Example/CNLiveMineModule.xcodeproj/project.pbxproj
| @@ -10,9 +10,7 @@ | @@ -10,9 +10,7 @@ | ||
| 10 | 084AE78223891906005C9A94 /* UIViewController+Present.m in Sources */ = {isa = PBXBuildFile; fileRef = 084AE78123891906005C9A94 /* UIViewController+Present.m */; }; | 10 | 084AE78223891906005C9A94 /* UIViewController+Present.m in Sources */ = {isa = PBXBuildFile; fileRef = 084AE78123891906005C9A94 /* UIViewController+Present.m */; }; |
| 11 | 08755590239B839E0025B3AE /* CNLiveWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0875558F239B839E0025B3AE /* CNLiveWebViewController.m */; }; | 11 | 08755590239B839E0025B3AE /* CNLiveWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0875558F239B839E0025B3AE /* CNLiveWebViewController.m */; }; |
| 12 | 08B0B213237D1A4D00337DEC /* CNLiveConfigurationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 08B0B211237D1A4D00337DEC /* CNLiveConfigurationManager.m */; }; | 12 | 08B0B213237D1A4D00337DEC /* CNLiveConfigurationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 08B0B211237D1A4D00337DEC /* CNLiveConfigurationManager.m */; }; |
| 13 | - 08B0B216237D1DE400337DEC /* CNLivePageJumpManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 08B0B215237D1DE400337DEC /* CNLivePageJumpManager.m */; }; | ||
| 14 | 08B0B219237D1FAF00337DEC /* CNLiveRootControllerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 08B0B218237D1FAE00337DEC /* CNLiveRootControllerManager.m */; }; | 13 | 08B0B219237D1FAF00337DEC /* CNLiveRootControllerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 08B0B218237D1FAE00337DEC /* CNLiveRootControllerManager.m */; }; |
| 15 | - 08B0B21C237D227700337DEC /* CNLiveNotificationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 08B0B21B237D227700337DEC /* CNLiveNotificationManager.m */; }; | ||
| 16 | 0F994A788957F1E7B1DD445B /* Pods_CNLiveMineModule_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 218A75B2DA9772C6C6C9B5D8 /* Pods_CNLiveMineModule_Tests.framework */; }; | 14 | 0F994A788957F1E7B1DD445B /* Pods_CNLiveMineModule_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 218A75B2DA9772C6C6C9B5D8 /* Pods_CNLiveMineModule_Tests.framework */; }; |
| 17 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; | 15 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; |
| 18 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; | 16 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; |
| @@ -49,13 +47,8 @@ | @@ -49,13 +47,8 @@ | ||
| 49 | 0875558F239B839E0025B3AE /* CNLiveWebViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveWebViewController.m; sourceTree = "<group>"; }; | 47 | 0875558F239B839E0025B3AE /* CNLiveWebViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveWebViewController.m; sourceTree = "<group>"; }; |
| 50 | 08B0B20E237D1A4D00337DEC /* CNLiveConfigurationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveConfigurationManager.h; sourceTree = "<group>"; }; | 48 | 08B0B20E237D1A4D00337DEC /* CNLiveConfigurationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveConfigurationManager.h; sourceTree = "<group>"; }; |
| 51 | 08B0B211237D1A4D00337DEC /* CNLiveConfigurationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveConfigurationManager.m; sourceTree = "<group>"; }; | 49 | 08B0B211237D1A4D00337DEC /* CNLiveConfigurationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveConfigurationManager.m; sourceTree = "<group>"; }; |
| 52 | - 08B0B214237D1DE400337DEC /* CNLivePageJumpManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLivePageJumpManager.h; sourceTree = "<group>"; }; | ||
| 53 | - 08B0B215237D1DE400337DEC /* CNLivePageJumpManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLivePageJumpManager.m; sourceTree = "<group>"; }; | ||
| 54 | 08B0B217237D1FAE00337DEC /* CNLiveRootControllerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveRootControllerManager.h; sourceTree = "<group>"; }; | 50 | 08B0B217237D1FAE00337DEC /* CNLiveRootControllerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveRootControllerManager.h; sourceTree = "<group>"; }; |
| 55 | 08B0B218237D1FAE00337DEC /* CNLiveRootControllerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveRootControllerManager.m; sourceTree = "<group>"; }; | 51 | 08B0B218237D1FAE00337DEC /* CNLiveRootControllerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveRootControllerManager.m; sourceTree = "<group>"; }; |
| 56 | - 08B0B21A237D227600337DEC /* CNLiveNotificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveNotificationManager.h; sourceTree = "<group>"; }; | ||
| 57 | - 08B0B21B237D227700337DEC /* CNLiveNotificationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveNotificationManager.m; sourceTree = "<group>"; }; | ||
| 58 | - 08B0B21D237D243000337DEC /* CNLiveNotificationName.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveNotificationName.h; sourceTree = "<group>"; }; | ||
| 59 | 1D378110366292D6352968E4 /* Pods-CNLiveMineModule_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveMineModule_Tests.release.xcconfig"; path = "Target Support Files/Pods-CNLiveMineModule_Tests/Pods-CNLiveMineModule_Tests.release.xcconfig"; sourceTree = "<group>"; }; | 52 | 1D378110366292D6352968E4 /* Pods-CNLiveMineModule_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveMineModule_Tests.release.xcconfig"; path = "Target Support Files/Pods-CNLiveMineModule_Tests/Pods-CNLiveMineModule_Tests.release.xcconfig"; sourceTree = "<group>"; }; |
| 60 | 218A75B2DA9772C6C6C9B5D8 /* Pods_CNLiveMineModule_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveMineModule_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | 53 | 218A75B2DA9772C6C6C9B5D8 /* Pods_CNLiveMineModule_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveMineModule_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; |
| 61 | 4E117669F0B64F8E94994BBB /* CNLiveMineModule.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CNLiveMineModule.podspec; path = ../CNLiveMineModule.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; | 54 | 4E117669F0B64F8E94994BBB /* CNLiveMineModule.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CNLiveMineModule.podspec; path = ../CNLiveMineModule.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; |
| @@ -153,11 +146,6 @@ | @@ -153,11 +146,6 @@ | ||
| 153 | children = ( | 146 | children = ( |
| 154 | 08B0B20E237D1A4D00337DEC /* CNLiveConfigurationManager.h */, | 147 | 08B0B20E237D1A4D00337DEC /* CNLiveConfigurationManager.h */, |
| 155 | 08B0B211237D1A4D00337DEC /* CNLiveConfigurationManager.m */, | 148 | 08B0B211237D1A4D00337DEC /* CNLiveConfigurationManager.m */, |
| 156 | - 08B0B21A237D227600337DEC /* CNLiveNotificationManager.h */, | ||
| 157 | - 08B0B21B237D227700337DEC /* CNLiveNotificationManager.m */, | ||
| 158 | - 08B0B21D237D243000337DEC /* CNLiveNotificationName.h */, | ||
| 159 | - 08B0B214237D1DE400337DEC /* CNLivePageJumpManager.h */, | ||
| 160 | - 08B0B215237D1DE400337DEC /* CNLivePageJumpManager.m */, | ||
| 161 | 08B0B217237D1FAE00337DEC /* CNLiveRootControllerManager.h */, | 149 | 08B0B217237D1FAE00337DEC /* CNLiveRootControllerManager.h */, |
| 162 | 08B0B218237D1FAE00337DEC /* CNLiveRootControllerManager.m */, | 150 | 08B0B218237D1FAE00337DEC /* CNLiveRootControllerManager.m */, |
| 163 | 6003F59C195388D20070C39A /* CNLIVEAppDelegate.h */, | 151 | 6003F59C195388D20070C39A /* CNLIVEAppDelegate.h */, |
| @@ -523,9 +511,7 @@ | @@ -523,9 +511,7 @@ | ||
| 523 | 6003F59E195388D20070C39A /* CNLIVEAppDelegate.m in Sources */, | 511 | 6003F59E195388D20070C39A /* CNLIVEAppDelegate.m in Sources */, |
| 524 | 08B0B213237D1A4D00337DEC /* CNLiveConfigurationManager.m in Sources */, | 512 | 08B0B213237D1A4D00337DEC /* CNLiveConfigurationManager.m in Sources */, |
| 525 | 084AE78223891906005C9A94 /* UIViewController+Present.m in Sources */, | 513 | 084AE78223891906005C9A94 /* UIViewController+Present.m in Sources */, |
| 526 | - 08B0B216237D1DE400337DEC /* CNLivePageJumpManager.m in Sources */, | ||
| 527 | 6003F5A7195388D20070C39A /* CNLIVEViewController.m in Sources */, | 514 | 6003F5A7195388D20070C39A /* CNLIVEViewController.m in Sources */, |
| 528 | - 08B0B21C237D227700337DEC /* CNLiveNotificationManager.m in Sources */, | ||
| 529 | 6003F59A195388D20070C39A /* main.m in Sources */, | 515 | 6003F59A195388D20070C39A /* main.m in Sources */, |
| 530 | 08755590239B839E0025B3AE /* CNLiveWebViewController.m in Sources */, | 516 | 08755590239B839E0025B3AE /* CNLiveWebViewController.m in Sources */, |
| 531 | 08B0B219237D1FAF00337DEC /* CNLiveRootControllerManager.m in Sources */, | 517 | 08B0B219237D1FAF00337DEC /* CNLiveRootControllerManager.m in Sources */, |
Example/CNLiveMineModule/CNLiveNotificationManager.h deleted
100644 โ 0
| 1 | -// | ||
| 2 | -// CNLiveNotificationManager.m | ||
| 3 | -// CNLiveMineModule | ||
| 4 | -// | ||
| 5 | -// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | -// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -/** | ||
| 10 | - * ้็ฅ | ||
| 11 | - */ | ||
| 12 | - | ||
| 13 | -#import <Foundation/Foundation.h> | ||
| 14 | -#import "CNLiveNotificationName.h" | ||
| 15 | - | ||
| 16 | -NS_ASSUME_NONNULL_BEGIN | ||
| 17 | - | ||
| 18 | -@interface CNLiveNotificationManager : NSObject | ||
| 19 | - | ||
| 20 | -+ (void)addObserver:(id)observer selector:(SEL)aSelector name:(nullable NSNotificationName)aName object:(nullable id)anObject; | ||
| 21 | - | ||
| 22 | -+ (void)postNotification:(NSNotification *)notification; | ||
| 23 | -+ (void)postNotificationName:(NSNotificationName)aName object:(nullable id)anObject; | ||
| 24 | -+ (void)postNotificationName:(NSNotificationName)aName object:(nullable id)anObject userInfo:(nullable NSDictionary *)aUserInfo; | ||
| 25 | - | ||
| 26 | -+ (void)removeObserver:(id)observer; | ||
| 27 | -+ (void)removeObserver:(id)observer name:(nullable NSNotificationName)aName object:(nullable id)anObject; | ||
| 28 | - | ||
| 29 | -@end | ||
| 30 | - | ||
| 31 | -NS_ASSUME_NONNULL_END |
Example/CNLiveMineModule/CNLiveNotificationManager.m deleted
100644 โ 0
| 1 | -// | ||
| 2 | -// CNLiveNotificationManager.m | ||
| 3 | -// CNLiveMineModule | ||
| 4 | -// | ||
| 5 | -// Created by 153993236@qq.com on 11/12/2019. | ||
| 6 | -// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -#import "CNLiveNotificationManager.h" | ||
| 10 | - | ||
| 11 | - | ||
| 12 | -@implementation CNLiveNotificationManager | ||
| 13 | -#pragma mark - add | ||
| 14 | -+ (void)addObserver:(id)observer selector:(SEL)aSelector name:(nullable NSNotificationName)aName object:(nullable id)anObject{ | ||
| 15 | - [[NSNotificationCenter defaultCenter] addObserver:observer selector:aSelector name:aName object:anObject]; | ||
| 16 | -} | ||
| 17 | - | ||
| 18 | -#pragma mark - post | ||
| 19 | -+ (void)postNotification:(NSNotification *)notification{ | ||
| 20 | - [[NSNotificationCenter defaultCenter] postNotification:notification]; | ||
| 21 | -} | ||
| 22 | -+ (void)postNotificationName:(NSNotificationName)aName object:(nullable id)anObject{ | ||
| 23 | - [[NSNotificationCenter defaultCenter] postNotificationName:aName object:anObject]; | ||
| 24 | -} | ||
| 25 | -+ (void)postNotificationName:(NSNotificationName)aName object:(nullable id)anObject userInfo:(nullable NSDictionary *)aUserInfo{ | ||
| 26 | - [[NSNotificationCenter defaultCenter] postNotificationName:aName object:anObject userInfo:aUserInfo]; | ||
| 27 | -} | ||
| 28 | - | ||
| 29 | -#pragma mark - remove | ||
| 30 | -+ (void)removeObserver:(id)observer{ | ||
| 31 | - [[NSNotificationCenter defaultCenter] removeObserver:observer]; | ||
| 32 | -} | ||
| 33 | - | ||
| 34 | -+ (void)removeObserver:(id)observer name:(nullable NSNotificationName)aName object:(nullable id)anObject{ | ||
| 35 | - [[NSNotificationCenter defaultCenter] removeObserver:observer name:aName object:anObject]; | ||
| 36 | - | ||
| 37 | -} | ||
| 38 | - | ||
| 39 | - | ||
| 40 | - | ||
| 41 | -@end |
Example/CNLiveMineModule/CNLiveNotificationName.h deleted
100644 โ 0
| 1 | -// | ||
| 2 | -// CNLiveNotificationName.h | ||
| 3 | -// CNLiveMineModule_Example | ||
| 4 | -// | ||
| 5 | -// Created by CNLive-zxw on 2019/11/14. | ||
| 6 | -// Copyright ยฉ 2019 153993236@qq.com. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -#ifndef CNLiveNotificationName_h | ||
| 10 | -#define CNLiveNotificationName_h | ||
| 11 | - | ||
| 12 | -#import <Foundation/Foundation.h> | ||
| 13 | - | ||
| 14 | -#pragma mark - ้ฆ้กต | ||
| 15 | - | ||
| 16 | -#pragma mark - ๅ็ฑป/่ง่ฎฏ | ||
| 17 | - | ||
| 18 | -#pragma mark - ๆๅก | ||
| 19 | - | ||
| 20 | -#pragma mark - ๆ็ | ||
| 21 | - | ||
| 22 | -#pragma mark - ็ปๅฝ/้ๅบ | ||
| 23 | -static NSString *const CNLiveLoginSuccess = @"CNLiveLoginSuccess"; | ||
| 24 | -static NSString *const CNLiveLogoutSuccess = @"CNLiveLogoutSuccess"; | ||
| 25 | -static NSString *const CNLiveUpdateUserInfoSuccess = @"CNLiveUpdateUserInfoSuccess"; | ||
| 26 | - | ||
| 27 | - | ||
| 28 | -#endif /* CNLiveNotificationName_h */ |
Example/CNLiveMineModule/CNLivePageJumpManager.h deleted
100644 โ 0
| 1 | -// | ||
| 2 | -// CNLivePageJumpManager.h | ||
| 3 | -// CNLiveServices | ||
| 4 | -// | ||
| 5 | -// Created by 153993236@qq.com on 07/22/2019. | ||
| 6 | -// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -/** | ||
| 10 | - * ้กต้ข่ทณ่ฝฌ | ||
| 11 | - */ | ||
| 12 | - | ||
| 13 | -#import <Foundation/Foundation.h> | ||
| 14 | -#import <UIKit/UIKit.h> | ||
| 15 | - | ||
| 16 | -NS_ASSUME_NONNULL_BEGIN | ||
| 17 | - | ||
| 18 | -@interface CNLivePageJumpManager : NSObject | ||
| 19 | - | ||
| 20 | -// jump | ||
| 21 | -+ (void)jumpViewController:(UIViewController *)controller; | ||
| 22 | -+ (void)jumpViewController:(UIViewController *)controller animated:(BOOL)animated; | ||
| 23 | - | ||
| 24 | -// back | ||
| 25 | -+ (void)backViewController; | ||
| 26 | -+ (void)backViewController:(BOOL)animated; | ||
| 27 | - | ||
| 28 | -// push | ||
| 29 | -+ (void)pushViewController:(UIViewController *)controller; | ||
| 30 | -+ (void)pushViewController:(UIViewController *)controller animated:(BOOL)animated; | ||
| 31 | - | ||
| 32 | -// pop | ||
| 33 | -+ (void)popViewController; | ||
| 34 | -+ (void)popViewControllerAnimated:(BOOL)animated; | ||
| 35 | -+ (void)popToViewController:(UIViewController *)viewController animated:(BOOL)animated; | ||
| 36 | -+ (void)popToRootViewControllerAnimated:(BOOL)animated; | ||
| 37 | - | ||
| 38 | -// present | ||
| 39 | -+ (void)presentViewController:(UIViewController *)controller; | ||
| 40 | -+ (void)presentViewController:(UIViewController *)controller animated:(BOOL)animated; | ||
| 41 | -+ (void)presentViewController:(UIViewController *)controller animated:(BOOL)animated completion:(nullable void(^)(void))completion; | ||
| 42 | - | ||
| 43 | -// dismiss | ||
| 44 | -+ (void)dismissViewController; | ||
| 45 | -+ (void)dismissViewControllerAnimated:(BOOL)animated completion:(nullable void(^)(void))completion; | ||
| 46 | - | ||
| 47 | -@end | ||
| 48 | - | ||
| 49 | -NS_ASSUME_NONNULL_END |
Example/CNLiveMineModule/CNLivePageJumpManager.m deleted
100644 โ 0
| 1 | -// | ||
| 2 | -// CNLivePageJumpManager.h | ||
| 3 | -// CNLiveServices | ||
| 4 | -// | ||
| 5 | -// Created by 153993236@qq.com on 07/22/2019. | ||
| 6 | -// Copyright (c) 2019 153993236@qq.com. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -#import "CNLivePageJumpManager.h" | ||
| 10 | - | ||
| 11 | -@interface CNLivePageJumpManager () | ||
| 12 | - | ||
| 13 | -@end | ||
| 14 | -@implementation CNLivePageJumpManager | ||
| 15 | -#pragma mark - ่ทๅ่ทๆงๅถๅจ | ||
| 16 | -+ (UINavigationController *)getNavigationController{ | ||
| 17 | - UIViewController *vc = [UIApplication sharedApplication].delegate.window.rootViewController; | ||
| 18 | - if ([vc isKindOfClass:[UINavigationController class]]){ | ||
| 19 | - return (UINavigationController *)vc; | ||
| 20 | - } | ||
| 21 | - else if ([vc isKindOfClass:[UITabBarController class]]){ | ||
| 22 | - UIViewController *select = [((UITabBarController *)vc) selectedViewController]; | ||
| 23 | - if ([select isKindOfClass:[UINavigationController class]]){ | ||
| 24 | - return (UINavigationController *)select; | ||
| 25 | - } | ||
| 26 | - } | ||
| 27 | - return nil; | ||
| 28 | -} | ||
| 29 | - | ||
| 30 | -#pragma mark - jump | ||
| 31 | -+ (void)jumpViewController:(UIViewController *)controller{ | ||
| 32 | - [self jumpViewController:controller animated:YES]; | ||
| 33 | -} | ||
| 34 | -+ (void)jumpViewController:(UIViewController *)controller animated:(BOOL)animated{ | ||
| 35 | - UINavigationController *nav = [self getNavigationController]; | ||
| 36 | - if(nav){ | ||
| 37 | - [nav pushViewController:controller animated:animated]; | ||
| 38 | - } | ||
| 39 | - else{ | ||
| 40 | - UIViewController *vc = [UIApplication sharedApplication].delegate.window.rootViewController; | ||
| 41 | - [vc presentViewController:controller animated:animated completion:nil]; | ||
| 42 | - } | ||
| 43 | -} | ||
| 44 | - | ||
| 45 | -#pragma mark - back | ||
| 46 | -+ (void)backViewController{ | ||
| 47 | - [self backViewController:YES]; | ||
| 48 | -} | ||
| 49 | -+ (void)backViewController:(BOOL)animated{ | ||
| 50 | - UINavigationController *nav = [self getNavigationController]; | ||
| 51 | - if(nav){ | ||
| 52 | - [nav popViewControllerAnimated:animated]; | ||
| 53 | - } | ||
| 54 | - else{ | ||
| 55 | - UIViewController *vc = [UIApplication sharedApplication].delegate.window.rootViewController; | ||
| 56 | - [vc dismissViewControllerAnimated:animated completion:nil]; | ||
| 57 | - } | ||
| 58 | -} | ||
| 59 | - | ||
| 60 | -#pragma mark - Push | ||
| 61 | -+ (void)pushViewController:(UIViewController *)controller{ | ||
| 62 | - [self pushViewController:controller animated:YES]; | ||
| 63 | -} | ||
| 64 | -+ (void)pushViewController:(UIViewController *)controller animated:(BOOL)animated{ | ||
| 65 | - [[self getNavigationController] pushViewController:controller animated:animated]; | ||
| 66 | -} | ||
| 67 | - | ||
| 68 | -#pragma mark - Pop | ||
| 69 | -+ (void)popViewController{ | ||
| 70 | - [self popViewControllerAnimated:YES]; | ||
| 71 | -} | ||
| 72 | -+ (void)popViewControllerAnimated:(BOOL)animated{ | ||
| 73 | - [[self getNavigationController] popViewControllerAnimated:animated]; | ||
| 74 | -} | ||
| 75 | -+ (void)popToViewController:(UIViewController *)viewController animated:(BOOL)animated{ | ||
| 76 | - [[self getNavigationController] popToViewController:viewController animated:animated]; | ||
| 77 | -} | ||
| 78 | -+ (void)popToRootViewControllerAnimated:(BOOL)animated{ | ||
| 79 | - [[self getNavigationController] popToRootViewControllerAnimated:animated]; | ||
| 80 | -} | ||
| 81 | - | ||
| 82 | -#pragma mark - Present | ||
| 83 | -+ (void)presentViewController:(UIViewController *)controller{ | ||
| 84 | - [self presentViewController:controller animated:YES]; | ||
| 85 | -} | ||
| 86 | -+ (void)presentViewController:(UIViewController *)controller animated:(BOOL)animated{ | ||
| 87 | - [self presentViewController:controller animated:animated completion:nil]; | ||
| 88 | -} | ||
| 89 | -+ (void)presentViewController:(UIViewController *)controller animated:(BOOL)animated completion:(nullable void(^)(void))completion{ | ||
| 90 | - [[self getNavigationController] presentViewController:controller animated:animated completion:completion]; | ||
| 91 | -} | ||
| 92 | - | ||
| 93 | -#pragma mark - Dismiss | ||
| 94 | -+ (void)dismissViewController{ | ||
| 95 | - [self dismissViewControllerAnimated:YES completion:nil]; | ||
| 96 | -} | ||
| 97 | -+ (void)dismissViewControllerAnimated:(BOOL)animated completion:(nullable void(^)(void))completion{ | ||
| 98 | - [[self getNavigationController] dismissViewControllerAnimated:animated completion:completion]; | ||
| 99 | - | ||
| 100 | -} | ||
| 101 | - | ||
| 102 | -@end |
Example/CNLiveMineModule/CNLiveWebViewController.m
| @@ -38,6 +38,7 @@ static const NSInteger margin = 10; | @@ -38,6 +38,7 @@ static const NSInteger margin = 10; | ||
| 38 | } | 38 | } |
| 39 | return self; | 39 | return self; |
| 40 | } | 40 | } |
| 41 | + | ||
| 41 | - (void)setTitle:(NSString *)title{ | 42 | - (void)setTitle:(NSString *)title{ |
| 42 | _titleLabel.text = title; | 43 | _titleLabel.text = title; |
| 43 | } | 44 | } |