增加换肤功能
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// TUIConversationObjectFactory.h
|
||||
// TUIConversation
|
||||
//
|
||||
// Created by wyl on 2023/3/29.
|
||||
// Copyright © 2023 Tencent. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <TIMCommon/TIMDefine.h>
|
||||
#import <TUICore/TUICore.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* TUIConversationService currently provides two services:
|
||||
* 1. Create a conversation list
|
||||
* 2. Create a conversation selector
|
||||
*
|
||||
* You can call the service through the [TUICore createObject:..] method. The different service parameters are as follows:
|
||||
* > Create a conversation list:
|
||||
* factoryName: TUICore_TUIConversationObjectFactory
|
||||
* key: TUICore_TUIConversationObjectFactory_GetConversationControllerMethod
|
||||
*
|
||||
* > Create conversation selector:
|
||||
* factoryName: TUICore_TUIConversationObjectFactory
|
||||
* key: TUICore_TUIConversationObjectFactory_ConversationSelectVC_Classic
|
||||
*
|
||||
*/
|
||||
@interface TUIConversationObjectFactory : NSObject
|
||||
+ (TUIConversationObjectFactory *)shareInstance;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// TUIConversationObjectFactory.m
|
||||
// TUIConversation
|
||||
//
|
||||
// Created by wyl on 2023/3/29.
|
||||
// Copyright © 2023 Tencent. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TUIConversationObjectFactory.h"
|
||||
#import <TUICore/TUIThemeManager.h>
|
||||
#import "TUIConversationListController.h"
|
||||
#import "TUIConversationSelectController.h"
|
||||
|
||||
@interface TUIConversationObjectFactory () <TUIObjectProtocol>
|
||||
@end
|
||||
|
||||
@implementation TUIConversationObjectFactory
|
||||
+ (void)load {
|
||||
[TUICore registerObjectFactory:TUICore_TUIConversationObjectFactory objectFactory:[TUIConversationObjectFactory shareInstance]];
|
||||
}
|
||||
+ (TUIConversationObjectFactory *)shareInstance {
|
||||
static dispatch_once_t onceToken;
|
||||
static TUIConversationObjectFactory *g_sharedInstance = nil;
|
||||
dispatch_once(&onceToken, ^{
|
||||
g_sharedInstance = [[TUIConversationObjectFactory alloc] init];
|
||||
});
|
||||
return g_sharedInstance;
|
||||
}
|
||||
|
||||
#pragma mark - TUIObjectProtocol
|
||||
- (id)onCreateObject:(NSString *)method param:(nullable NSDictionary *)param {
|
||||
if ([method isEqualToString:TUICore_TUIConversationObjectFactory_GetConversationControllerMethod]) {
|
||||
return [self createConversationController];
|
||||
} else if ([method isEqualToString:TUICore_TUIConversationObjectFactory_ConversationSelectVC_Classic]) {
|
||||
return [self createConversationSelectController];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (UIViewController *)createConversationController {
|
||||
return [[TUIConversationListController alloc] init];
|
||||
}
|
||||
|
||||
- (UIViewController *)createConversationSelectController {
|
||||
return [[TUIConversationSelectController alloc] init];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
// Created by Tencent on 2023/06/09.
|
||||
// Copyright © 2023 Tencent. All rights reserved.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <TIMCommon/TIMDefine.h>
|
||||
#import <TUICore/TUICore.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TUIConversationService : NSObject
|
||||
|
||||
+ (TUIConversationService *)shareInstance;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
// Created by Tencent on 2023/06/09.
|
||||
// Copyright © 2023 Tencent. All rights reserved.
|
||||
|
||||
#import "TUIConversationService.h"
|
||||
|
||||
@implementation TUIConversationService
|
||||
|
||||
static NSString *gServiceName = nil;
|
||||
|
||||
+ (void)load {
|
||||
TUIRegisterThemeResourcePath(TUIConversationThemePath, TUIThemeModuleConversation);
|
||||
}
|
||||
|
||||
+ (TUIConversationService *)shareInstance {
|
||||
static dispatch_once_t onceToken;
|
||||
static TUIConversationService *g_sharedInstance = nil;
|
||||
dispatch_once(&onceToken, ^{
|
||||
g_sharedInstance = [[TUIConversationService alloc] init];
|
||||
});
|
||||
return g_sharedInstance;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user