Commit cb954db331a2946f0568af1b8b82e3452dc25695
1 parent
f63c1510
no message
Showing
5 changed files
with
24 additions
and
9 deletions
CNLiveEnvironment.podspec
| ... | ... | @@ -31,7 +31,8 @@ TODO: Add long description of the pod here. |
| 31 | 31 | s.ios.deployment_target = '9.0' |
| 32 | 32 | |
| 33 | 33 | s.source_files = 'CNLiveEnvironment/Classes/**/*' |
| 34 | - | |
| 34 | + s.dependency 'CNLiveServices' | |
| 35 | + | |
| 35 | 36 | # s.resource_bundles = { |
| 36 | 37 | # 'CNLiveEnvironment' => ['CNLiveEnvironment/Assets/*.png'] |
| 37 | 38 | # } | ... | ... |
CNLiveEnvironment/Classes/CNLiveEnvironmentManager.h
| ... | ... | @@ -7,16 +7,17 @@ |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import <Foundation/Foundation.h> |
| 10 | +#import "CNLiveEnvironmentServiceProtocol.h" | |
| 10 | 11 | |
| 11 | 12 | NS_ASSUME_NONNULL_BEGIN |
| 12 | 13 | |
| 13 | -typedef NS_ENUM(NSInteger, CNLiveEnvironmentType) { | |
| 14 | - CNLiveDebugInHouse = 0,//测试企业环境 | |
| 15 | - CNLiveProductionInHouse = 1,//正式企业环境 | |
| 16 | - CNLiveDebugAppStore = 2,//测试商店环境 | |
| 17 | - CNLiveProductionAppStore = 3 //正式商店环境 | |
| 18 | - | |
| 19 | -}; | |
| 14 | +//typedef NS_ENUM(NSInteger, CNLiveEnvironmentType) { | |
| 15 | +// CNLiveDebugInHouse = 0,//测试企业环境 | |
| 16 | +// CNLiveProductionInHouse = 1,//正式企业环境 | |
| 17 | +// CNLiveDebugAppStore = 2,//测试商店环境 | |
| 18 | +// CNLiveProductionAppStore = 3 //正式商店环境 | |
| 19 | +// | |
| 20 | +//}; | |
| 20 | 21 | |
| 21 | 22 | @interface CNLiveEnvironmentManager : NSObject |
| 22 | 23 | ... | ... |
CNLiveEnvironment/Classes/CNLiveEnvironmentManager.m
| ... | ... | @@ -7,7 +7,10 @@ |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import "CNLiveEnvironmentManager.h" |
| 10 | -@interface CNLiveEnvironmentManager() | |
| 10 | + | |
| 11 | +@BeeHiveService(CNLiveEnvironmentServiceProtocol,CNLiveEnvironmentManager) | |
| 12 | + | |
| 13 | +@interface CNLiveEnvironmentManager()<CNLiveEnvironmentServiceProtocol> | |
| 11 | 14 | @property (nonatomic, assign, readwrite) CNLiveEnvironmentType isEnvironment; //详细环境 |
| 12 | 15 | @property (nonatomic, assign, readwrite) BOOL isTestEnvironment; // 是否是测试环境 |
| 13 | 16 | |
| ... | ... | @@ -414,4 +417,10 @@ static CNLiveEnvironmentManager *_instance = nil; |
| 414 | 417 | |
| 415 | 418 | } |
| 416 | 419 | |
| 420 | +#pragma mark - CNLiveEnvironmentServiceProtocol | |
| 421 | +- (void)setEnvironment:(CNLiveEnvironmentType)isEnvironment{ | |
| 422 | + [CNLiveEnvironmentManager setEnvironment:isEnvironment]; | |
| 423 | + | |
| 424 | +} | |
| 425 | + | |
| 417 | 426 | @end | ... | ... |
Example/CNLiveEnvironment.xcodeproj/project.pbxproj
| ... | ... | @@ -306,12 +306,14 @@ |
| 306 | 306 | ); |
| 307 | 307 | inputPaths = ( |
| 308 | 308 | "${PODS_ROOT}/Target Support Files/Pods-CNLiveEnvironment_Example/Pods-CNLiveEnvironment_Example-frameworks.sh", |
| 309 | + "${BUILT_PRODUCTS_DIR}/BeeHive/BeeHive.framework", | |
| 309 | 310 | "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework", |
| 310 | 311 | ); |
| 311 | 312 | name = "[CP] Embed Pods Frameworks"; |
| 312 | 313 | outputFileListPaths = ( |
| 313 | 314 | ); |
| 314 | 315 | outputPaths = ( |
| 316 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BeeHive.framework", | |
| 315 | 317 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework", |
| 316 | 318 | ); |
| 317 | 319 | runOnlyForDeploymentPostprocessing = 0; | ... | ... |