Commit 789944fbb3b979723e7df29d4aad518a7078527c
1 parent
6998e73f
no message
Showing
13 changed files
with
470 additions
and
7 deletions
CNLiveMineModule/Classes/Controller/CNLiveMineController.m
| ... | ... | @@ -43,7 +43,7 @@ static const NSInteger kHEIGHT = 250; |
| 43 | 43 | @"name":@"常用工具", |
| 44 | 44 | @"style":@"2", |
| 45 | 45 | @"margin":@"10", |
| 46 | - @"titles": @[@"收货地址", @"余额", @"我的收藏",@"发布记录",@"邀请好友",@"设置",@"路径工具"], | |
| 46 | + @"titles": @[@"收货地址", @"补贴余额", @"我的收藏",@"发布记录",@"邀请好友",@"设置",@"路径工具"], | |
| 47 | 47 | @"images":@[@"mine_address",@"mine_card",@"mine_like",@"mine_release",@"mine_invitation",@"mine_set",@"mine_tool_map"] |
| 48 | 48 | }, |
| 49 | 49 | @{ | ... | ... |
CNLiveMineModule/Classes/Module/CNLiveMineService.m
CNLiveMineModule/Classes/View/CNLiveMineCell.m
| ... | ... | @@ -315,7 +315,7 @@ |
| 315 | 315 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 316 | 316 | btn.tag = tag; |
| 317 | 317 | btn.frame = frame; |
| 318 | - btn.titleLabel.font = [UIFont systemFontOfSize:14]; | |
| 318 | + btn.titleLabel.font = [UIFont systemFontOfSize:13]; | |
| 319 | 319 | btn.titleLabel.textAlignment = NSTextAlignmentCenter; |
| 320 | 320 | btn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;//使图片和文字水平居中显示 |
| 321 | 321 | ... | ... |
Example/CNLiveMineModule.xcodeproj/project.pbxproj
| ... | ... | @@ -7,6 +7,10 @@ |
| 7 | 7 | objects = { |
| 8 | 8 | |
| 9 | 9 | /* Begin PBXBuildFile section */ |
| 10 | + 08B0B213237D1A4D00337DEC /* CNLiveConfigurationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 08B0B211237D1A4D00337DEC /* CNLiveConfigurationManager.m */; }; | |
| 11 | + 08B0B216237D1DE400337DEC /* CNLivePageJumpManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 08B0B215237D1DE400337DEC /* CNLivePageJumpManager.m */; }; | |
| 12 | + 08B0B219237D1FAF00337DEC /* CNLiveRootControllerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 08B0B218237D1FAE00337DEC /* CNLiveRootControllerManager.m */; }; | |
| 13 | + 08B0B21C237D227700337DEC /* CNLiveNotificationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 08B0B21B237D227700337DEC /* CNLiveNotificationManager.m */; }; | |
| 10 | 14 | 0F994A788957F1E7B1DD445B /* Pods_CNLiveMineModule_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 218A75B2DA9772C6C6C9B5D8 /* Pods_CNLiveMineModule_Tests.framework */; }; |
| 11 | 15 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; |
| 12 | 16 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; |
| ... | ... | @@ -37,6 +41,15 @@ |
| 37 | 41 | /* End PBXContainerItemProxy section */ |
| 38 | 42 | |
| 39 | 43 | /* Begin PBXFileReference section */ |
| 44 | + 08B0B20E237D1A4D00337DEC /* CNLiveConfigurationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveConfigurationManager.h; sourceTree = "<group>"; }; | |
| 45 | + 08B0B211237D1A4D00337DEC /* CNLiveConfigurationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveConfigurationManager.m; sourceTree = "<group>"; }; | |
| 46 | + 08B0B214237D1DE400337DEC /* CNLivePageJumpManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLivePageJumpManager.h; sourceTree = "<group>"; }; | |
| 47 | + 08B0B215237D1DE400337DEC /* CNLivePageJumpManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLivePageJumpManager.m; sourceTree = "<group>"; }; | |
| 48 | + 08B0B217237D1FAE00337DEC /* CNLiveRootControllerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveRootControllerManager.h; sourceTree = "<group>"; }; | |
| 49 | + 08B0B218237D1FAE00337DEC /* CNLiveRootControllerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveRootControllerManager.m; sourceTree = "<group>"; }; | |
| 50 | + 08B0B21A237D227600337DEC /* CNLiveNotificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveNotificationManager.h; sourceTree = "<group>"; }; | |
| 51 | + 08B0B21B237D227700337DEC /* CNLiveNotificationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveNotificationManager.m; sourceTree = "<group>"; }; | |
| 52 | + 08B0B21D237D243000337DEC /* CNLiveNotificationName.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveNotificationName.h; sourceTree = "<group>"; }; | |
| 40 | 53 | 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>"; }; |
| 41 | 54 | 218A75B2DA9772C6C6C9B5D8 /* Pods_CNLiveMineModule_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CNLiveMineModule_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; |
| 42 | 55 | 4E117669F0B64F8E94994BBB /* CNLiveMineModule.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CNLiveMineModule.podspec; path = ../CNLiveMineModule.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; |
| ... | ... | @@ -132,6 +145,15 @@ |
| 132 | 145 | 6003F593195388D20070C39A /* Example for CNLiveMineModule */ = { |
| 133 | 146 | isa = PBXGroup; |
| 134 | 147 | children = ( |
| 148 | + 08B0B20E237D1A4D00337DEC /* CNLiveConfigurationManager.h */, | |
| 149 | + 08B0B211237D1A4D00337DEC /* CNLiveConfigurationManager.m */, | |
| 150 | + 08B0B21A237D227600337DEC /* CNLiveNotificationManager.h */, | |
| 151 | + 08B0B21B237D227700337DEC /* CNLiveNotificationManager.m */, | |
| 152 | + 08B0B21D237D243000337DEC /* CNLiveNotificationName.h */, | |
| 153 | + 08B0B214237D1DE400337DEC /* CNLivePageJumpManager.h */, | |
| 154 | + 08B0B215237D1DE400337DEC /* CNLivePageJumpManager.m */, | |
| 155 | + 08B0B217237D1FAE00337DEC /* CNLiveRootControllerManager.h */, | |
| 156 | + 08B0B218237D1FAE00337DEC /* CNLiveRootControllerManager.m */, | |
| 135 | 157 | 6003F59C195388D20070C39A /* CNLIVEAppDelegate.h */, |
| 136 | 158 | 6003F59D195388D20070C39A /* CNLIVEAppDelegate.m */, |
| 137 | 159 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, |
| ... | ... | @@ -207,7 +229,7 @@ |
| 207 | 229 | 6003F586195388D20070C39A /* Sources */, |
| 208 | 230 | 6003F587195388D20070C39A /* Frameworks */, |
| 209 | 231 | 6003F588195388D20070C39A /* Resources */, |
| 210 | - 17B0223499DC450ECBD06406 /* [CP] Embed Pods Frameworks */, | |
| 232 | + 0F54581AB8DB61CE975ACA9C /* [CP] Embed Pods Frameworks */, | |
| 211 | 233 | ); |
| 212 | 234 | buildRules = ( |
| 213 | 235 | ); |
| ... | ... | @@ -298,7 +320,7 @@ |
| 298 | 320 | /* End PBXResourcesBuildPhase section */ |
| 299 | 321 | |
| 300 | 322 | /* Begin PBXShellScriptBuildPhase section */ |
| 301 | - 17B0223499DC450ECBD06406 /* [CP] Embed Pods Frameworks */ = { | |
| 323 | + 0F54581AB8DB61CE975ACA9C /* [CP] Embed Pods Frameworks */ = { | |
| 302 | 324 | isa = PBXShellScriptBuildPhase; |
| 303 | 325 | buildActionMask = 2147483647; |
| 304 | 326 | files = ( |
| ... | ... | @@ -307,7 +329,6 @@ |
| 307 | 329 | "${PODS_ROOT}/Target Support Files/Pods-CNLiveMineModule_Example/Pods-CNLiveMineModule_Example-frameworks.sh", |
| 308 | 330 | "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework", |
| 309 | 331 | "${BUILT_PRODUCTS_DIR}/CNLiveMineModule/CNLiveMineModule.framework", |
| 310 | - "${BUILT_PRODUCTS_DIR}/CNLiveServices/CNLiveServices.framework", | |
| 311 | 332 | "${BUILT_PRODUCTS_DIR}/CNLiveTripartiteManagement/CNLiveTripartiteManagement.framework", |
| 312 | 333 | "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework", |
| 313 | 334 | "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework", |
| ... | ... | @@ -319,7 +340,6 @@ |
| 319 | 340 | outputPaths = ( |
| 320 | 341 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework", |
| 321 | 342 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveMineModule.framework", |
| 322 | - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveServices.framework", | |
| 323 | 343 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveTripartiteManagement.framework", |
| 324 | 344 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework", |
| 325 | 345 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework", |
| ... | ... | @@ -384,8 +404,12 @@ |
| 384 | 404 | buildActionMask = 2147483647; |
| 385 | 405 | files = ( |
| 386 | 406 | 6003F59E195388D20070C39A /* CNLIVEAppDelegate.m in Sources */, |
| 407 | + 08B0B213237D1A4D00337DEC /* CNLiveConfigurationManager.m in Sources */, | |
| 408 | + 08B0B216237D1DE400337DEC /* CNLivePageJumpManager.m in Sources */, | |
| 387 | 409 | 6003F5A7195388D20070C39A /* CNLIVEViewController.m in Sources */, |
| 410 | + 08B0B21C237D227700337DEC /* CNLiveNotificationManager.m in Sources */, | |
| 388 | 411 | 6003F59A195388D20070C39A /* main.m in Sources */, |
| 412 | + 08B0B219237D1FAF00337DEC /* CNLiveRootControllerManager.m in Sources */, | |
| 389 | 413 | ); |
| 390 | 414 | runOnlyForDeploymentPostprocessing = 0; |
| 391 | 415 | }; | ... | ... |
Example/CNLiveMineModule/CNLiveConfigurationManager.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveConfigurationManager.h | |
| 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 | + * 1.配置公共系统 | |
| 12 | + * 2.配置三方库 | |
| 13 | + */ | |
| 14 | + | |
| 15 | +#import <Foundation/Foundation.h> | |
| 16 | +#import <UIKit/UIKit.h> | |
| 17 | +NS_ASSUME_NONNULL_BEGIN | |
| 18 | + | |
| 19 | +@interface CNLiveConfigurationManager : NSObject | |
| 20 | + | |
| 21 | +/** | |
| 22 | + * 配置 | |
| 23 | + */ | |
| 24 | ++ (void)configuration; | |
| 25 | + | |
| 26 | +/** | |
| 27 | + * 公共系统配置 | |
| 28 | + */ | |
| 29 | ++ (void)defaultConfiguration; | |
| 30 | + | |
| 31 | +/** | |
| 32 | + * 三方库配置 | |
| 33 | + */ | |
| 34 | ++ (void)thirdPartyConfiguration; | |
| 35 | + | |
| 36 | +@end | |
| 37 | + | |
| 38 | +NS_ASSUME_NONNULL_END | ... | ... |
Example/CNLiveMineModule/CNLiveConfigurationManager.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveConfigurationManager.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 "CNLiveConfigurationManager.h" | |
| 10 | + | |
| 11 | +@implementation CNLiveConfigurationManager | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 配置 | |
| 15 | + */ | |
| 16 | ++ (void)configuration{ | |
| 17 | + [self defaultConfiguration]; | |
| 18 | + [self thirdPartyConfiguration]; | |
| 19 | + | |
| 20 | +} | |
| 21 | + | |
| 22 | +#pragma mark - 默认公共系统配置 | |
| 23 | +/** | |
| 24 | + * 公共系统配置 | |
| 25 | + */ | |
| 26 | ++ (void)defaultConfiguration{ | |
| 27 | + [UITabBar appearance].translucent = NO; | |
| 28 | + | |
| 29 | + // 防止视图同时点击 | |
| 30 | + [UIView appearance].exclusiveTouch = YES; | |
| 31 | + | |
| 32 | + // 防止UITableView刷新跳动 | |
| 33 | + [UITableView appearance].estimatedRowHeight = 0; | |
| 34 | + [UITableView appearance].estimatedSectionHeaderHeight = 0; | |
| 35 | + [UITableView appearance].estimatedSectionFooterHeight = 0; | |
| 36 | + | |
| 37 | +} | |
| 38 | + | |
| 39 | +#pragma mark - 三方库配置 | |
| 40 | +/** | |
| 41 | + * 三方库配置 | |
| 42 | + */ | |
| 43 | ++ (void)thirdPartyConfiguration{ | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | +} | |
| 48 | + | |
| 49 | +@end | ... | ... |
Example/CNLiveMineModule/CNLiveNotificationManager.h
0 → 100644
| 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
0 → 100644
| 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
0 → 100644
| 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
0 → 100644
| 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
0 → 100644
| 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/CNLiveRootControllerManager.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveRootControllerManager.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 | + | |
| 15 | +NS_ASSUME_NONNULL_BEGIN | |
| 16 | + | |
| 17 | +@interface CNLiveRootControllerManager : NSObject | |
| 18 | + | |
| 19 | +/** | |
| 20 | + * 进入主页面 | |
| 21 | + */ | |
| 22 | ++ (void)enterMainUI; | |
| 23 | + | |
| 24 | +/** | |
| 25 | + * 进入TabBar面 | |
| 26 | + */ | |
| 27 | ++ (void)enterTabBarUI; | |
| 28 | + | |
| 29 | +/** | |
| 30 | + * 进入登录页面 | |
| 31 | + */ | |
| 32 | ++ (void)enterLoginUI; | |
| 33 | + | |
| 34 | +@end | |
| 35 | + | |
| 36 | +NS_ASSUME_NONNULL_END | ... | ... |
Example/CNLiveMineModule/CNLiveRootControllerManager.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveRootControllerManager.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 "CNLiveRootControllerManager.h" | |
| 10 | + | |
| 11 | + | |
| 12 | +@implementation CNLiveRootControllerManager | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 设置主页面 | |
| 16 | + */ | |
| 17 | ++ (void)enterMainUI{ | |
| 18 | + // 判断是否展示引导页 | |
| 19 | + if (@"是否展示引导页") { | |
| 20 | + | |
| 21 | + | |
| 22 | + }else{ | |
| 23 | + if(@"是否登录"){ | |
| 24 | + // 设置TabBar面 | |
| 25 | + [self enterTabBarUI]; | |
| 26 | + | |
| 27 | + }else{ | |
| 28 | + // 设置登录页面 | |
| 29 | + [self enterLoginUI]; | |
| 30 | + | |
| 31 | + } | |
| 32 | + } | |
| 33 | + | |
| 34 | +} | |
| 35 | + | |
| 36 | +/** | |
| 37 | + * 设置TabBar面 | |
| 38 | + */ | |
| 39 | ++ (void)enterTabBarUI{ | |
| 40 | + for (UIView *view in [UIApplication sharedApplication].delegate.window.subviews) { | |
| 41 | + [view removeFromSuperview]; | |
| 42 | + } | |
| 43 | + [UIApplication sharedApplication].delegate.window.rootViewController = nil; | |
| 44 | + UITabBarController *tabBar = [[UITabBarController alloc]init]; | |
| 45 | + UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:tabBar]; | |
| 46 | + [UIApplication sharedApplication].delegate.window.rootViewController = nav; | |
| 47 | + | |
| 48 | +} | |
| 49 | + | |
| 50 | +/** | |
| 51 | + * 设置登录页面 | |
| 52 | + */ | |
| 53 | ++ (void)enterLoginUI{ | |
| 54 | + for (UIView *view in [UIApplication sharedApplication].delegate.window.subviews) { | |
| 55 | + [view removeFromSuperview]; | |
| 56 | + } | |
| 57 | + [UIApplication sharedApplication].delegate.window.rootViewController = nil; | |
| 58 | +// CNLiveLoginController *login = [[CNLiveLoginController alloc]init]; | |
| 59 | +// UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:login]; | |
| 60 | +// [UIApplication sharedApplication].delegate.window.rootViewController = nav; | |
| 61 | + | |
| 62 | +} | |
| 63 | + | |
| 64 | + | |
| 65 | +@end | ... | ... |