Commit cb954db331a2946f0568af1b8b82e3452dc25695

Authored by zhangxiaowen
1 parent f63c1510

no message

CNLiveEnvironment.podspec
@@ -31,7 +31,8 @@ TODO: Add long description of the pod here. @@ -31,7 +31,8 @@ TODO: Add long description of the pod here.
31 s.ios.deployment_target = '9.0' 31 s.ios.deployment_target = '9.0'
32 32
33 s.source_files = 'CNLiveEnvironment/Classes/**/*' 33 s.source_files = 'CNLiveEnvironment/Classes/**/*'
34 - 34 + s.dependency 'CNLiveServices'
  35 +
35 # s.resource_bundles = { 36 # s.resource_bundles = {
36 # 'CNLiveEnvironment' => ['CNLiveEnvironment/Assets/*.png'] 37 # 'CNLiveEnvironment' => ['CNLiveEnvironment/Assets/*.png']
37 # } 38 # }
CNLiveEnvironment/Classes/CNLiveEnvironmentManager.h
@@ -7,16 +7,17 @@ @@ -7,16 +7,17 @@
7 // 7 //
8 8
9 #import <Foundation/Foundation.h> 9 #import <Foundation/Foundation.h>
  10 +#import "CNLiveEnvironmentServiceProtocol.h"
10 11
11 NS_ASSUME_NONNULL_BEGIN 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 @interface CNLiveEnvironmentManager : NSObject 22 @interface CNLiveEnvironmentManager : NSObject
22 23
CNLiveEnvironment/Classes/CNLiveEnvironmentManager.m
@@ -7,7 +7,10 @@ @@ -7,7 +7,10 @@
7 // 7 //
8 8
9 #import "CNLiveEnvironmentManager.h" 9 #import "CNLiveEnvironmentManager.h"
10 -@interface CNLiveEnvironmentManager() 10 +
  11 +@BeeHiveService(CNLiveEnvironmentServiceProtocol,CNLiveEnvironmentManager)
  12 +
  13 +@interface CNLiveEnvironmentManager()<CNLiveEnvironmentServiceProtocol>
11 @property (nonatomic, assign, readwrite) CNLiveEnvironmentType isEnvironment; //详细环境 14 @property (nonatomic, assign, readwrite) CNLiveEnvironmentType isEnvironment; //详细环境
12 @property (nonatomic, assign, readwrite) BOOL isTestEnvironment; // 是否是测试环境 15 @property (nonatomic, assign, readwrite) BOOL isTestEnvironment; // 是否是测试环境
13 16
@@ -414,4 +417,10 @@ static CNLiveEnvironmentManager *_instance = nil; @@ -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 @end 426 @end
Example/CNLiveEnvironment.xcodeproj/project.pbxproj
@@ -306,12 +306,14 @@ @@ -306,12 +306,14 @@
306 ); 306 );
307 inputPaths = ( 307 inputPaths = (
308 "${PODS_ROOT}/Target Support Files/Pods-CNLiveEnvironment_Example/Pods-CNLiveEnvironment_Example-frameworks.sh", 308 "${PODS_ROOT}/Target Support Files/Pods-CNLiveEnvironment_Example/Pods-CNLiveEnvironment_Example-frameworks.sh",
  309 + "${BUILT_PRODUCTS_DIR}/BeeHive/BeeHive.framework",
309 "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework", 310 "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework",
310 ); 311 );
311 name = "[CP] Embed Pods Frameworks"; 312 name = "[CP] Embed Pods Frameworks";
312 outputFileListPaths = ( 313 outputFileListPaths = (
313 ); 314 );
314 outputPaths = ( 315 outputPaths = (
  316 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BeeHive.framework",
315 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework", 317 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework",
316 ); 318 );
317 runOnlyForDeploymentPostprocessing = 0; 319 runOnlyForDeploymentPostprocessing = 0;
Example/Podfile
1 use_frameworks! 1 use_frameworks!
  2 +source 'https://github.com/CocoaPods/Specs.git'
  3 +source 'http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git'
2 4
3 platform :ios, '9.0' 5 platform :ios, '9.0'
4 6