Skip to content

Commit

Permalink
update doc #15 #14
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoxiaobao authored and oldratlee committed Sep 6, 2016
1 parent 8e41ace commit eff6f7b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
Binary file added Docs/extended-common-events-en.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/system-event-workflow-en.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 21 additions & 19 deletions README.md
Expand Up @@ -92,14 +92,16 @@ Events are divided into three types:

System events are usually Application life-cycle events , such as DidBecomeActive, WillEnterBackground etc.
System Event basic workflow is as follows:
![](http://gtms01.alicdn.com/tps/i1/TB1OrsXIFXXXXaoXFXXjWC18pXX-1119-552.jpg)

![](Docs/system-event-workflow-en.png)

## 1.2 Universal Event

On the basis of system events on the extended general application events , such modSetup, modInit , etc. , may be used to code each plug-in module initialization settings

Extended common events are as follows :
![](http://gtms04.alicdn.com/tps/i4/TB1lOH5IFXXXXX6XVXXZJGkYVXX-1523-552.jpg)

![](Docs/extended-common-events-en.png)

## 1.3 Business Custom Event

Expand Down Expand Up @@ -187,7 +189,7 @@ Usually in the form of three types to access service:
2. by `Export Method`(like `PHP`/`ReactNatve` extension)
3. by `URL Route` pattern(like interaction between iPhone apps)

Interface type of service access can take the advantages of compile-time checking is found to change the interface , so that timely correction interface issues . The disadvantage is the need to rely on the interface definition header file by the module increases the more the maintenance interface definition there is a certain amount of work .
Interface type of service access can take the advantages of compile-time checking is found to change the interface , so that timely correction interface issues . The disadvantage is the need to rely on the interface definition header file by the module increases the more the maintenance interface definition there is a certain amount of work .

### 3.4.1 Declare service interface

Expand All @@ -206,17 +208,17 @@ Case thought HomeServiceProtocol:
There are three ways to register ViewController Service.

#### Declarative registration

```objc
@implementation HomeService

BH_EXPORT_SERVICE()

@end
```

#### API registration

```objc
[[BeeHive shareInstance] registerService:@protocol(HomeServiceProtocol) service:[BHViewController class]];
```
Expand Down Expand Up @@ -271,32 +273,32 @@ Initial setup application project information , and share information across app
```objc
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[BHContext shareInstance].env = BHEnvironmentDev;
[BHContext shareInstance].env = BHEnvironmentDev;
[BHContext shareInstance].application = application;
[BHContext shareInstance].launchOptions = launchOptions;
[BHContext shareInstance].moduleConfigName = @"BeeHive.bundle/CustomModulePlist";
[BHContext shareInstance].serviceConfigName = @"BeeHive.bundle/CustomServicePlist";
[BHContext shareInstance].appkey = xxxxxx;
[BHContext shareInstance].Mtopkey = xxxxx;
[[BeeHive shareInstance] setContext:[BHContext shareInstance]];
[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];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.rootViewController = navCtrl;
[self.window makeKeyAndVisible];
}
Expand Down

0 comments on commit eff6f7b

Please sign in to comment.