Latest 0.0.1
Homepage https://github.com/Lobster-King/IQService
License MIT
Platforms ios 7.0
Authors

iOS端模块间通信解决方案。

使用方式

一、通过Cocoapods引入工程。

pod 'IQService'

二、编写一个服务类。

首先创建LoginModuleCookieService类,并将该类注册到LoginModule中。
.h声明
#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface LoginModuleCookieService : NSObject

- (NSString *)getCookieWithSignature:(NSString *)signature;

@end

NS_ASSUME_NONNULL_END
.m实现
#import "LoginModuleCookieService.h"

@implementation LoginModuleCookieService

- (NSString *)getCookieWithSignature:(NSString *)signature {
    return [NSString stringWithFormat:@"%@->cookie",signature];
}

@end

三、调用该服务:

同步调用
NSString *cookie = [IQService invokeMicroServiceSync:@"GetCookieSyncService",@"我是同步调用",nil];
NSLog(@"%@",cookie);
异步调用
void (^callBack)(NSString *) = ^(NSString *cookie){
        NSLog(@"%@",cookie);
    };
[IQService invokeMicroService:@"GetCookieAsyncService",@"我是异步调用",callBack,nil];

IQService路线图

  • 支持多种注册方式,动态注册,注解方案等。目前仅支持静态注册。
  • 在编译器进行参数有效性校验。

联系我

PRs or Issues.
Email:[email protected]

Latest podspec

{
    "name": "IQService",
    "version": "0.0.1",
    "summary": "iOSu7aefu6a21u5757u95f4u901au4fe1u89e3u51b3u65b9u6848u3002",
    "description": "A solution for decoupling modules in iOS platform.",
    "homepage": "https://github.com/Lobster-King/IQService",
    "license": "MIT",
    "authors": {
        "Lobster-King": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/Lobster-King/IQService.git",
        "tag": "0.0.1"
    },
    "source_files": [
        "IQService",
        "IQService/**/*.{h,m}"
    ],
    "exclude_files": "IQService/Exclude"
}

Pin It on Pinterest

Share This