123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- //
- // YOUPAIBBNIMSessionConfigurator.m
- // VQU
- //
- // Created by Elaine on 2021/10/26.
- // Copyright © 2021 MS. All rights reserved.
- //
- #import "YOUPAIBBNIMSessionConfigurator.h"
- #import "NIMSessionMsgDatasource.h"
- #import "NIMSessionInteractorImpl.h"
- #import "NIMCustomLeftBarView.h"
- #import "UIView+NIM.h"
- #import "NIMMessageModel.h"
- #import "NIMGlobalMacro.h"
- #import "NIMSessionDataSourceImpl.h"
- #import "YOUPAIBBNIMSessionLayoutImpl.h"
- #import "NIMSessionTableAdapter.h"
- /*
- NIMSessionViewController 类关系图
-
-
- .........................................................................
- . .
- . .
- . . | ---> [NIMSessionDatasource]
- . .
- . | ---> [NIMSessionInteractor] --> |
- .
- . | ---> [NIMSessionLayout]
- .
- ↓
- [NIMSessionViewController]-------> [NIMSessionConfigurator] -----> |
- |
- |
- |
- |
- ↓ | ---> [NIMSessionTableAdapter]
- [UITableView] .
- ↑ .
- . .
- . .
- .......................................................................
- */
- @interface YOUPAIBBNIMSessionConfigurator()
- @property (nonatomic,strong) NIMSessionInteractorImpl *youpaipinteractor;
- @property (nonatomic,strong) NIMSessionTableAdapter *youpaiptableAdapter;
- @end
- @implementation YOUPAIBBNIMSessionConfigurator
- - (void)youpaifsetup:(YOUPAIBBNIMSessionViewController *)vc
- {
- NIMSession *session = vc.session;
- id<NIMSessionConfig> sessionConfig = vc.sessionConfig;
- UITableView *tableView = vc.tableView;
- YOUPAIBBNIMInputView *inputView = vc.youpaipsessionInputView;
-
- NIMSessionDataSourceImpl *datasource = [[NIMSessionDataSourceImpl alloc] initWithSession:session config:sessionConfig];
- YOUPAIBBNIMSessionLayoutImpl *layout = [[YOUPAIBBNIMSessionLayoutImpl alloc] initWithSession:session config:sessionConfig];
- layout.youpaiptableView = tableView;
- layout.youpaipinputView = inputView;
-
-
- _youpaipinteractor = [[NIMSessionInteractorImpl alloc] initWithSession:session config:sessionConfig];
- _youpaipinteractor.delegate = vc;
- _youpaipinteractor.dataSource = datasource;
- _youpaipinteractor.layout = layout;
-
- [layout setDelegate:_youpaipinteractor];
-
- _youpaiptableAdapter = [[NIMSessionTableAdapter alloc] init];
- _youpaiptableAdapter.interactor = _youpaipinteractor;
- _youpaiptableAdapter.delegate = vc;
- vc.tableView.delegate = _youpaiptableAdapter;
- vc.tableView.dataSource = _youpaiptableAdapter;
- [vc setInteractor:_youpaipinteractor];
- }
- - (void)youpaifuc_setup:(YOUPAIBBUCIMP2PSessionVC *)vc
- {
- NIMSession *session = vc.session;
- id<NIMSessionConfig> sessionConfig = vc.sessionConfig;
- UITableView *tableView = vc.youpaiptableView;
- YOUPAIBBNIMInputView *inputView = vc.youpaipsessionInputView;
-
- NIMSessionDataSourceImpl *datasource = [[NIMSessionDataSourceImpl alloc] initWithSession:session config:sessionConfig];
- YOUPAIBBNIMSessionLayoutImpl *layout = [[YOUPAIBBNIMSessionLayoutImpl alloc] initWithSession:session config:sessionConfig];
- layout.youpaiptableView = tableView;
- layout.youpaipinputView = inputView;
-
-
- _youpaipinteractor = [[NIMSessionInteractorImpl alloc] initWithSession:session config:sessionConfig];
- _youpaipinteractor.delegate = vc;
- _youpaipinteractor.dataSource = datasource;
- _youpaipinteractor.layout = layout;
-
- [layout setDelegate:_youpaipinteractor];
-
- _youpaiptableAdapter = [[NIMSessionTableAdapter alloc] init];
- _youpaiptableAdapter.interactor = _youpaipinteractor;
- _youpaiptableAdapter.delegate = vc;
- vc.youpaiptableView.delegate = _youpaiptableAdapter;
- vc.youpaiptableView.dataSource = _youpaiptableAdapter;
-
-
- [vc setYoupaipinteractor:_youpaipinteractor];
- }
- @end
|