22 lines
643 B
Objective-C
Executable File
22 lines
643 B
Objective-C
Executable File
//
|
|
// TPServiceProtocol.h
|
|
// TinyPart
|
|
//
|
|
// Created by Yao Li on 2018/4/9.
|
|
// Copyright © 2018年 yaoli. All rights reserved.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import "TPServiceManager.h"
|
|
|
|
#define TPSERVICE_AUTO_REGISTER(protocol_name) \
|
|
+ (void)load { \
|
|
[[TPServiceManager sharedInstance] registerService:@protocol(protocol_name) impClass:[self class]];}
|
|
|
|
#define MTService(protocol_name) ((id<protocol_name>)([[TPServiceManager sharedInstance] serviceWithName:NSStringFromProtocol(@protocol(protocol_name))]))
|
|
@protocol TPServiceProtocol <NSObject>
|
|
@optional
|
|
+ (instancetype)sharedInstance;
|
|
+ (instancetype)serviceImplement;
|
|
@end
|