- 浏览: 59841 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (93)
- java (3)
- ios (9)
- wp (15)
- android (0)
- js (1)
- 服务器 (0)
- db (0)
- linux (1)
- python (0)
- xcode (0)
- ide (2)
- maven (0)
- spring (0)
- sql (0)
- 第三方 (1)
- nexus (0)
- nginx (11)
- tomcat (0)
- jenkins (0)
- zookeeper (1)
- git (1)
- svn (0)
- uml (0)
- redis (4)
- activemq (1)
- flume (0)
- kafka (0)
- mysql (1)
- memcached (0)
- mybatis (0)
- mac (0)
- mongo (1)
- docker (6)
- cache (0)
- jvm (0)
- markdown (0)
- springboot (24)
- mycat (3)
- LTS (3)
- 运维 (0)
- opts (1)
- netty (1)
- tcc (0)
- ffmpeg (2)
- 直播 (6)
- cxf (0)
- nodejs (0)
- storm (0)
- elasticjob (0)
- php (0)
最新评论
添加PrefixHeader.pch:参见:(http://www.jianshu.com/p/a19bb67d705e)
#ifndef PrefixHeader_pch
#define PrefixHeader_pch
#import "BeeHive.h"
#import "BHTimeProfiler.h"
#endif
=====================
Podfile:
platform :ios, '7.0'
target "TestBeehive" do
pod "BeeHive", '1.0.0'
end
=====================
在项目根目录下添加
--------------------
BeeHive.plist:
--------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>moduleClasses</key>
<array>
<dict>
<key>moduleClass</key>
<string>TestService</string>
<key>moduleLevel</key>
<integer>1</integer>
</dict>
</array>
</dict>
</plist>
--------------------
BHService.plist:
--------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>service</key>
<string>HomeServiceProtocol</string>
<key>impl</key>
<string>ViewController</string>
</dict>
</array>
</plist>
=====================
--------------------
AppDelegate.h
--------------------
#import <UIKit/UIKit.h>
@interface AppDelegate : BHAppDelegate <UIApplicationDelegate>
@end
--------------------
AppDelegate.m
--------------------
#import "AppDelegate.h"
#import "HomeServiceProtocol.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//[BHContext shareInstance].env = BHEnvironmentDev;
[BHContext shareInstance].application = application;
[BHContext shareInstance].launchOptions = launchOptions;
[BHContext shareInstance].moduleConfigName = @"BeeHive";//可选,默认为BeeHive.bundle/BeeHive.plist
[BHContext shareInstance].serviceConfigName = @"BHService";
[BeeHive shareInstance].enableExpection = YES;
[[BeeHive shareInstance] setContext:[BHContext shareInstance]];
[[BHTimeProfiler sharedTimeProfiler] recordEventTime:@"BeeHive::super start launch"];
[super application:application didFinishLaunchingWithOptions:launchOptions];
id<HomeServiceProtocol> homeVc = [[BeeHive shareInstance] createService:@protocol(HomeServiceProtocol)];
if ([homeVc isKindOfClass:[UIViewController class]]) {
UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:(UIViewController*)homeVc];
[navCtrl setNavigationBarHidden:YES];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.rootViewController = navCtrl;
[self.window makeKeyAndVisible];
}
return YES;
}
=====================
--------------------
ViewController.h
--------------------
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
--------------------
ViewController.m
--------------------
#import "ViewController.h"
#import "HomeServiceProtocol.h"
//BeeHiveService(HomeServiceProtocol,ViewController)
@interface ViewController()<HomeServiceProtocol>
@end
@implementation ViewController
-(instancetype)init
{
self = [super init];
if (self) {
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
}
-(void)registerViewController:(UIViewController *)vc title:(NSString *)title iconName:(NSString *)iconName
{
// vc.tabBarItem.image = [UIImage imageNamed:[NSString stringWithFormat:@"Home.bundle/%@", iconName]];
// vc.tabBarItem.title = title;
//
// [self.registerViewControllers addObject:vc];
//
// self.viewControllers = self.registerViewControllers;
NSLog(@"test-======");
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
@end
=====================
--------------------
HomeServiceProtocol.h
--------------------
#import <Foundation/Foundation.h>
@protocol HomeServiceProtocol <NSObject, BHServiceProtocol>
-(void)registerViewController:(UIViewController *)vc title:(NSString *)title iconName:(NSString *)iconName;
@end
=====================
--------------------
TestService.h
--------------------
#import <Foundation/Foundation.h>
@interface TestService : NSObject
@end
--------------------
TestService.m
--------------------
#import "TestService.h"
#import "HomeServiceProtocol.h"
#import "ViewController.h"
@interface TestService()<BHModuleProtocol>
@end
@implementation TestService
//BH_EXPORT_MODULE(YES)
-(void)modInit:(BHContext *)context
{
switch (context.env) {
case BHEnvironmentDev:
//....初始化开发环境
break;
case BHEnvironmentProd:
//....初始化生产环境
default:
break;
}
}
- (void)modSetUp:(BHContext *)context
{
//[[BeeHive shareInstance]registerService:@protocol(HomeServiceProtocol) service:[ViewController class]];
NSLog(@"TradeModule setup");
}
=====================
=====================
#ifndef PrefixHeader_pch
#define PrefixHeader_pch
#import "BeeHive.h"
#import "BHTimeProfiler.h"
#endif
=====================
Podfile:
platform :ios, '7.0'
target "TestBeehive" do
pod "BeeHive", '1.0.0'
end
=====================
在项目根目录下添加
--------------------
BeeHive.plist:
--------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>moduleClasses</key>
<array>
<dict>
<key>moduleClass</key>
<string>TestService</string>
<key>moduleLevel</key>
<integer>1</integer>
</dict>
</array>
</dict>
</plist>
--------------------
BHService.plist:
--------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>service</key>
<string>HomeServiceProtocol</string>
<key>impl</key>
<string>ViewController</string>
</dict>
</array>
</plist>
=====================
--------------------
AppDelegate.h
--------------------
#import <UIKit/UIKit.h>
@interface AppDelegate : BHAppDelegate <UIApplicationDelegate>
@end
--------------------
AppDelegate.m
--------------------
#import "AppDelegate.h"
#import "HomeServiceProtocol.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//[BHContext shareInstance].env = BHEnvironmentDev;
[BHContext shareInstance].application = application;
[BHContext shareInstance].launchOptions = launchOptions;
[BHContext shareInstance].moduleConfigName = @"BeeHive";//可选,默认为BeeHive.bundle/BeeHive.plist
[BHContext shareInstance].serviceConfigName = @"BHService";
[BeeHive shareInstance].enableExpection = YES;
[[BeeHive shareInstance] setContext:[BHContext shareInstance]];
[[BHTimeProfiler sharedTimeProfiler] recordEventTime:@"BeeHive::super start launch"];
[super application:application didFinishLaunchingWithOptions:launchOptions];
id<HomeServiceProtocol> homeVc = [[BeeHive shareInstance] createService:@protocol(HomeServiceProtocol)];
if ([homeVc isKindOfClass:[UIViewController class]]) {
UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:(UIViewController*)homeVc];
[navCtrl setNavigationBarHidden:YES];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.rootViewController = navCtrl;
[self.window makeKeyAndVisible];
}
return YES;
}
=====================
--------------------
ViewController.h
--------------------
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
--------------------
ViewController.m
--------------------
#import "ViewController.h"
#import "HomeServiceProtocol.h"
//BeeHiveService(HomeServiceProtocol,ViewController)
@interface ViewController()<HomeServiceProtocol>
@end
@implementation ViewController
-(instancetype)init
{
self = [super init];
if (self) {
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
}
-(void)registerViewController:(UIViewController *)vc title:(NSString *)title iconName:(NSString *)iconName
{
// vc.tabBarItem.image = [UIImage imageNamed:[NSString stringWithFormat:@"Home.bundle/%@", iconName]];
// vc.tabBarItem.title = title;
//
// [self.registerViewControllers addObject:vc];
//
// self.viewControllers = self.registerViewControllers;
NSLog(@"test-======");
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
@end
=====================
--------------------
HomeServiceProtocol.h
--------------------
#import <Foundation/Foundation.h>
@protocol HomeServiceProtocol <NSObject, BHServiceProtocol>
-(void)registerViewController:(UIViewController *)vc title:(NSString *)title iconName:(NSString *)iconName;
@end
=====================
--------------------
TestService.h
--------------------
#import <Foundation/Foundation.h>
@interface TestService : NSObject
@end
--------------------
TestService.m
--------------------
#import "TestService.h"
#import "HomeServiceProtocol.h"
#import "ViewController.h"
@interface TestService()<BHModuleProtocol>
@end
@implementation TestService
//BH_EXPORT_MODULE(YES)
-(void)modInit:(BHContext *)context
{
switch (context.env) {
case BHEnvironmentDev:
//....初始化开发环境
break;
case BHEnvironmentProd:
//....初始化生产环境
default:
break;
}
}
- (void)modSetUp:(BHContext *)context
{
//[[BeeHive shareInstance]registerService:@protocol(HomeServiceProtocol) service:[ViewController class]];
NSLog(@"TradeModule setup");
}
=====================
=====================
发表评论
-
ios:IJKMediaPlayer
2017-09-27 12:02 885https://github.com/Bilibili/ijk ... -
ios:jspatch
2017-06-14 15:44 673jspatch https://jspatch.com/Doc ... -
ios:Masonry
2017-06-06 11:48 915https://github.com/SnapKit/Maso ... -
ios:fastlane
2017-06-06 11:48 698gem install fastlane 基于linux : ... -
ios 常量
2017-01-12 11:14 0NSString * const MyOwnConstant ... -
ios testflight
2017-01-12 10:51 0testflight testflight testfligh ... -
ios perFormSelector
2017-01-10 17:38 0perFormSelector是编译时候动态的去找方法的,在编 ... -
ios NSRunLoop
2017-01-10 17:10 0一个ios程序启动后,只有短短的十行代码居然能保持整个应用程序 ... -
ios viewDidUnload分析
2017-01-10 17:13 0viewDidUnload运行前提: 1.内存不足时执行,执 ... -
ios NSAutoreleasePool
2017-01-10 17:13 0NSAutoreleasePool对象引用自动处理器,他是一个 ... -
ios:oc实现排序算法
2017-01-11 13:32 583下面是我用oc实现的快速排序,冒泡排序,直接插入排序和折半插入 ... -
ios:设计模式
2017-06-06 12:51 320=============================== ... -
ios category
2017-01-10 16:25 0=============================== ... -
ios block property
2017-01-10 16:20 0============================ Lo ... -
ios controller解耦
2017-01-10 15:30 0使用: [self.ynav openURL:[NSURL U ... -
ios:jsbridge
2017-06-06 11:54 476=============================== ... -
ios code
2016-12-18 12:14 00. po self._textViewContent. ... -
ios:pods安装
2016-09-20 13:42 4851.安装xcode 2.安装commad line ...
相关推荐
**Swift-BeeHive:iOS应用模块化开发框架详解** Swift-BeeHive 是一个专为iOS应用程序设计的模块化开发框架,它旨在提高代码的可维护性、可扩展性和可复用性。通过将应用划分为独立的模块,开发者可以更有效地管理...
【BeeHive基于iOS大型项目解耦方案】 在iOS应用开发中,随着项目的规模不断扩大,业务线的增多,代码的耦合度逐渐升高,这不仅导致了性能问题,也使得开发、测试和维护变得困难。针对这些问题,BeeHive提出了一种...
iOS 模块化编程框架 BeeHive ,BeeHive是用于ios的app模块化编程的框架实现方案,吸收了Spring框架service的理...
这里提到的BeeHive是由阿里巴巴开发的一个开源框架,专门用于实现iOS应用的模块化。 BeeHive借鉴了Java中的Spring Framework API服务概念,这个概念强调的是依赖注入(Dependency Injection),即通过外部容器来...
去耦套件播客文件platform :ios , '7.0'pod 'DecouplingKit' , '~> 0.0.2' DecouplingKit,在iOS项目中的模块之间解耦。 DDKServiceManager,用于加载服务列表DKService.plist,该服务是企业的协议。 DKService....
1. **Apache Beehive**:这是一个已退役的项目,曾经提供了一组用于构建企业Java应用程序的服务框架。它的目标是简化Java EE开发模型,减少样板代码的编写。 2. **Apache Attic**:这是Apache基金会的一个存储库,...
同时,针对移动设备的复杂性,如Android的多版本和机型、iOS的审核周期,阿里巴巴建立了自动化适配测试系统,包括MQC(Mobile Quality Center)和MQC for iOS,涵盖了兼容性测试、功能测试、稳定性测试等多个方面,...
同时,通过模块解耦工具如Beehive来管理依赖,利用容器化技术,如UICoreLogicSDKs和SDKsBundle,以及中间件Bus,实现了工程的解耦和单工程容器化,从而支持多团队并行开发,减少了开发冲突和发布阻塞。 在稳定性...
Andfix、Tlog、Atlas、BeeHive等技术或服务,是用于热修复、日志记录、应用框架构建和消息推送的工具或框架,它们可以快速响应并修复已上线应用中的问题,提高应用质量和用户体验。 最后,文档提到了网络安全方面的...