프로젝트
GitHub에서 보기
NianJi/AppLord
소개
module and service management of ios app
웹 및 앱 개발측정된 스타 증가
- in 24h
- +1
- in 7 days
- +2
- in 15 days
- +2
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalAppLord
module and service management of ios app
add to your project
management by cocoapods, use:
pod 'AppLord'
module
what is module? every business or task could be module.
when the module init? when app launch or after app launch
how to impl?
first, create class:
#import <AppLord/AppLord.h>
@interface MyModule : NSObject <ALModule>
@end
then, impl like this:
@AppLordModule(MyModule) // Annotation for regist the module, required
@implementation MyModule
// module object init
- (void)moduleDidInit:(ALContext *)context
{
// do some init thing
}
@end
service
we can receive events from other modules in a module, but it does not always meet the demand. we can't notify back to the sender. so we provide another way to transfer event between modules: service.
How to use?
Define your custom service
@protocol MyService <ALService>
- (void)doSomething;
@end
Impl it
@interface MyServiceImpl : NSObject <MyService>
@end
@AppLordService(MyService, MyServiceImpl) // regist MyService's Impl class: MyServiceImpl
@implementation MyServiceImpl
- (void)doSomething
{
}
// optional
+ (BOOL)globalVisible
{
// if return YES, service will be always in the memory
}
@end
How to get the instance of service?
id<MyService> service = [[ALContext sharedContext] findServiceByName:@"MyService"];
// or
id<MyService> service = [[ALContext sharedContext] findService:@protocol(MyService)];
관련 프로젝트 살펴보기
불러오는 중…