room vc 协议整理
This commit is contained in:
@@ -462,6 +462,7 @@
|
|||||||
181D7F1F2727D9DB00B7C059 /* SocialStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SocialStageView.h; sourceTree = "<group>"; };
|
181D7F1F2727D9DB00B7C059 /* SocialStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SocialStageView.h; sourceTree = "<group>"; };
|
||||||
181D7F202727D9DB00B7C059 /* SocialStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SocialStageView.m; sourceTree = "<group>"; };
|
181D7F202727D9DB00B7C059 /* SocialStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SocialStageView.m; sourceTree = "<group>"; };
|
||||||
181D7F222727DB1E00B7C059 /* RoomHostDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomHostDelegate.h; sourceTree = "<group>"; };
|
181D7F222727DB1E00B7C059 /* RoomHostDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomHostDelegate.h; sourceTree = "<group>"; };
|
||||||
|
1845C6412790320E00016EAC /* RoomAnimationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomAnimationProtocol.h; sourceTree = "<group>"; };
|
||||||
18486211271EA9DA005FC5DC /* RtcManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RtcManager.h; sourceTree = "<group>"; };
|
18486211271EA9DA005FC5DC /* RtcManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RtcManager.h; sourceTree = "<group>"; };
|
||||||
18486212271EA9DA005FC5DC /* RtcManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RtcManager.m; sourceTree = "<group>"; };
|
18486212271EA9DA005FC5DC /* RtcManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RtcManager.m; sourceTree = "<group>"; };
|
||||||
18486214271EAA03005FC5DC /* RtcDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RtcDelegate.h; sourceTree = "<group>"; };
|
18486214271EAA03005FC5DC /* RtcDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RtcDelegate.h; sourceTree = "<group>"; };
|
||||||
@@ -2972,6 +2973,12 @@
|
|||||||
E8DEC9962764A51F0078CB70 /* MoreView */,
|
E8DEC9962764A51F0078CB70 /* MoreView */,
|
||||||
E838D99D275E1B6C0079E0B5 /* AnimationView */,
|
E838D99D275E1B6C0079E0B5 /* AnimationView */,
|
||||||
E82325EA274E2D52003A3332 /* UserCard */,
|
E82325EA274E2D52003A3332 /* UserCard */,
|
||||||
|
E8AEAEE827141ACC0017FCE0 /* RoomHeaderView */,
|
||||||
|
E8AEAEEA27141ACC0017FCE0 /* StageView */,
|
||||||
|
E8AEAEE627141ACC0017FCE0 /* MessageContainerView */,
|
||||||
|
E8AEAEE527141ACC0017FCE0 /* ActivityContainerView */,
|
||||||
|
E8AEAEE727141ACC0017FCE0 /* BaseUIContainerView */,
|
||||||
|
E8AEAEE927141ACC0017FCE0 /* MenuContainerView */,
|
||||||
E8AEAED4271412EC0017FCE0 /* XPRoomViewController.h */,
|
E8AEAED4271412EC0017FCE0 /* XPRoomViewController.h */,
|
||||||
E8AEAED5271412EC0017FCE0 /* XPRoomViewController.m */,
|
E8AEAED5271412EC0017FCE0 /* XPRoomViewController.m */,
|
||||||
E816C11327608A7500C84014 /* XPRoomMiniManager.h */,
|
E816C11327608A7500C84014 /* XPRoomMiniManager.h */,
|
||||||
@@ -2979,12 +2986,7 @@
|
|||||||
181D7F222727DB1E00B7C059 /* RoomHostDelegate.h */,
|
181D7F222727DB1E00B7C059 /* RoomHostDelegate.h */,
|
||||||
180806F827298F9B001FD836 /* RoomGuestDelegate.h */,
|
180806F827298F9B001FD836 /* RoomGuestDelegate.h */,
|
||||||
186F8B472733F2AE007A17BC /* MicroQueueProtocol.h */,
|
186F8B472733F2AE007A17BC /* MicroQueueProtocol.h */,
|
||||||
E8AEAEE827141ACC0017FCE0 /* RoomHeaderView */,
|
1845C6412790320E00016EAC /* RoomAnimationProtocol.h */,
|
||||||
E8AEAEEA27141ACC0017FCE0 /* StageView */,
|
|
||||||
E8AEAEE627141ACC0017FCE0 /* MessageContainerView */,
|
|
||||||
E8AEAEE527141ACC0017FCE0 /* ActivityContainerView */,
|
|
||||||
E8AEAEE727141ACC0017FCE0 /* BaseUIContainerView */,
|
|
||||||
E8AEAEE927141ACC0017FCE0 /* MenuContainerView */,
|
|
||||||
180806F92729A354001FD836 /* ThemeColor+Room.h */,
|
180806F92729A354001FD836 /* ThemeColor+Room.h */,
|
||||||
180806FA2729A354001FD836 /* ThemeColor+Room.m */,
|
180806FA2729A354001FD836 /* ThemeColor+Room.m */,
|
||||||
E866B6E32759F96F009B002A /* XPMiniRoomView.h */,
|
E866B6E32759F96F009B002A /* XPMiniRoomView.h */,
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface XPRoomAnimationView : XPRoomAnimationHitView <RoomGuestDelegate>
|
@interface XPRoomAnimationView : XPRoomAnimationHitView <RoomGuestDelegate>
|
||||||
- (instancetype)initWithdelegate:(id<RoomHostDelegate>)delegate;
|
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -95,7 +95,7 @@
|
|||||||
[[NIMSDK sharedSDK].broadcastManager removeDelegate:self];
|
[[NIMSDK sharedSDK].broadcastManager removeDelegate:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithdelegate:(id<RoomHostDelegate>)delegate {
|
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
[[NIMSDK sharedSDK].broadcastManager addDelegate:self];
|
[[NIMSDK sharedSDK].broadcastManager addDelegate:self];
|
||||||
@@ -192,8 +192,8 @@
|
|||||||
NSString * targetUid= [NSString stringWithFormat:@"%ld", datingModel.targetUid];
|
NSString * targetUid= [NSString stringWithFormat:@"%ld", datingModel.targetUid];
|
||||||
NSString * uid= [NSString stringWithFormat:@"%ld", datingModel.uid];
|
NSString * uid= [NSString stringWithFormat:@"%ld", datingModel.uid];
|
||||||
if (datingModel.hasHeart || datingModel.hasSelectUser) {
|
if (datingModel.hasHeart || datingModel.hasSelectUser) {
|
||||||
datingModel.originPoint = [self.delegate centerForUserAtUid:uid];
|
datingModel.originPoint = [self.delegate animationPointAtStageViewByUid:uid];
|
||||||
datingModel.targetPoint = [self.delegate centerForUserAtUid:targetUid];
|
datingModel.targetPoint = [self.delegate animationPointAtStageViewByUid:targetUid];
|
||||||
}
|
}
|
||||||
XPRoomDatingAnimationView * datingView = [[XPRoomDatingAnimationView alloc] init];
|
XPRoomDatingAnimationView * datingView = [[XPRoomDatingAnimationView alloc] init];
|
||||||
[self.highLevleView addSubview:datingView];
|
[self.highLevleView addSubview:datingView];
|
||||||
@@ -448,7 +448,7 @@
|
|||||||
|
|
||||||
///起点
|
///起点
|
||||||
- (CGPoint)getGiftAnimationPoint:(NSString *)uid isEnd:(BOOL)isEnd{
|
- (CGPoint)getGiftAnimationPoint:(NSString *)uid isEnd:(BOOL)isEnd{
|
||||||
CGPoint point = [self.delegate centerForUserAtUid:uid];
|
CGPoint point = [self.delegate animationPointAtStageViewByUid:uid];
|
||||||
//没有找到那个点 那个用户不再坑位上
|
//没有找到那个点 那个用户不再坑位上
|
||||||
if (point.x <= 0 || point.y <= 0) {
|
if (point.x <= 0 || point.y <= 0) {
|
||||||
if (isEnd) {
|
if (isEnd) {
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
// MicroQueueProtocol.h
|
// MicroQueueProtocol.h
|
||||||
// xplan-ios
|
// xplan-ios
|
||||||
//
|
//
|
||||||
// Created by apple on 2021/11/4.
|
// Created by zu on 2021/11/4.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
@@ -11,11 +11,28 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
@class MicroQueueModel;
|
@class MicroQueueModel;
|
||||||
|
|
||||||
|
/** 麦序数据的协议。
|
||||||
|
|
||||||
|
RoomVC 的子 View 之间的通信协议,通过 RoomHostDelegate 和 RoomGuestDelegate 继承实现。
|
||||||
|
|
||||||
|
调用方向:
|
||||||
|
|
||||||
|
- getMicroQueue:RoomVC 子 View —> RoomHostDelegate —> StageView
|
||||||
|
- onMicroQueueUpdate:StageView —> RoomHostDelegate —> RoomVC 子 View
|
||||||
|
|
||||||
|
*/
|
||||||
@protocol MicroQueueProtocol <NSObject>
|
@protocol MicroQueueProtocol <NSObject>
|
||||||
|
|
||||||
@optional
|
@optional
|
||||||
|
/**
|
||||||
|
* 获取麦序。
|
||||||
|
*/
|
||||||
- (NSMutableDictionary<NSString *, MicroQueueModel *>*)getMicroQueue;
|
- (NSMutableDictionary<NSString *, MicroQueueModel *>*)getMicroQueue;
|
||||||
|
/**
|
||||||
|
* 麦序更新通知。
|
||||||
|
*/
|
||||||
- (void)onMicroQueueUpdate:(NSMutableDictionary<NSString *, MicroQueueModel *>*)queue;
|
- (void)onMicroQueueUpdate:(NSMutableDictionary<NSString *, MicroQueueModel *>*)queue;
|
||||||
- (CGPoint)centerForUserAtUid:(NSString *)uid;
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
29
xplan-ios/Main/Room/View/RoomAnimationProtocol.h
Normal file
29
xplan-ios/Main/Room/View/RoomAnimationProtocol.h
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
//
|
||||||
|
// RoomAnimationProtocol.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by zu on 2022/1/13.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
/** XPRoomAnimationView 用到的协议。
|
||||||
|
|
||||||
|
RoomVC 的子 View 之间的通信协议,通过 RoomHostDelegate 和 RoomGuestDelegate 继承实现。
|
||||||
|
|
||||||
|
调用方向:XPRoomAnimationView —> RoomHostDelegate —> RoomAnimationProtocol(RoomGuestDelegate继承)
|
||||||
|
|
||||||
|
*/
|
||||||
|
@protocol RoomAnimationProtocol <NSObject>
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/**
|
||||||
|
* StageView 专用。
|
||||||
|
*/
|
||||||
|
- (CGPoint)animationPointAtStageViewByUid:(NSString *)uid;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@@ -6,13 +6,25 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "MicroQueueProtocol.h"
|
||||||
|
#import "RoomAnimationProtocol.h"
|
||||||
|
|
||||||
@class NIMMessage;
|
@class NIMMessage;
|
||||||
@class AttachmentModel;
|
@class AttachmentModel;
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@protocol RoomGuestDelegate <NSObject, MicroQueueProtocol>
|
/** RoomVC 子 View 的通用协议。
|
||||||
|
|
||||||
|
调用方向:RoomVC —> RoomGuestDelegate
|
||||||
|
|
||||||
|
**Note:**
|
||||||
|
|
||||||
|
继承 MicroQueueProtocol、RoomAnimationProtocol 等协议用于子 View 做实现。
|
||||||
|
实现后的调用方向:子 View —> RoomHostDelegate —> XXXProtocol(RoomGuestDelegate)。
|
||||||
|
|
||||||
|
*/
|
||||||
|
@protocol RoomGuestDelegate <NSObject, MicroQueueProtocol, RoomAnimationProtocol>
|
||||||
|
|
||||||
@optional
|
@optional
|
||||||
|
|
||||||
@@ -22,6 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
- (void)handleNIMNotificationMessage:(NIMMessage *)message;
|
- (void)handleNIMNotificationMessage:(NIMMessage *)message;
|
||||||
- (void)handleNIMCustomMessage:(NIMMessage *)message;
|
- (void)handleNIMCustomMessage:(NIMMessage *)message;
|
||||||
- (void)handleNIMTextMessage:(NIMMessage *)message;
|
- (void)handleNIMTextMessage:(NIMMessage *)message;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -7,13 +7,24 @@
|
|||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "MicroQueueProtocol.h"
|
#import "MicroQueueProtocol.h"
|
||||||
|
#import "RoomAnimationProtocol.h"
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@class RoomInfoModel;
|
@class RoomInfoModel;
|
||||||
@class UserInfoModel;
|
@class UserInfoModel;
|
||||||
|
|
||||||
@protocol RoomHostDelegate <NSObject, MicroQueueProtocol>
|
/** RoomVC 与子 View 之间的通信协议。
|
||||||
|
|
||||||
|
调用方向:子 View —> RoomHostDelegate。
|
||||||
|
|
||||||
|
**Note:**
|
||||||
|
|
||||||
|
继承 MicroQueueProtocol、RoomAnimationProtocol 等协议是为了做桥接。
|
||||||
|
实现后的调用方向:子 View —> RoomHostDelegate —> XXXProtocol(RoomGuestDelegate)。
|
||||||
|
|
||||||
|
*/
|
||||||
|
@protocol RoomHostDelegate <NSObject, MicroQueueProtocol, RoomAnimationProtocol>
|
||||||
|
|
||||||
- (RoomInfoModel*)getRoomInfo;
|
- (RoomInfoModel*)getRoomInfo;
|
||||||
- (UserInfoModel*)getUserInfo;
|
- (UserInfoModel*)getUserInfo;
|
||||||
|
@@ -104,7 +104,7 @@
|
|||||||
return ownerHeight + marginV1 + mcHeight + marginV2 + mcHeight + marginV3;
|
return ownerHeight + marginV1 + mcHeight + marginV2 + mcHeight + marginV3;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (CGPoint)centerForUserAtUid:(NSString *)uid {
|
- (CGPoint)animationPointAtStageViewByUid:(NSString *)uid {
|
||||||
NSInteger index = [self getIndexByUid:uid];
|
NSInteger index = [self getIndexByUid:uid];
|
||||||
CGPoint point = CGPointZero;
|
CGPoint point = CGPointZero;
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
|
@@ -72,7 +72,7 @@
|
|||||||
return ownerHeight + marginV1 + mcHeight + marginV2 + mcHeight + marginV2;
|
return ownerHeight + marginV1 + mcHeight + marginV2 + mcHeight + marginV2;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (CGPoint)centerForUserAtUid:(NSString *)uid {
|
- (CGPoint)animationPointAtStageViewByUid:(NSString *)uid {
|
||||||
NSInteger index = [self getIndexByUid:uid];
|
NSInteger index = [self getIndexByUid:uid];
|
||||||
CGPoint point = CGPointZero;
|
CGPoint point = CGPointZero;
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
|
@@ -568,8 +568,8 @@ UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
|
|||||||
[self.functionView onRoomUpdate];
|
[self.functionView onRoomUpdate];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (CGPoint)centerForUserAtUid:(NSString *)uid {
|
- (CGPoint)animationPointAtStageViewByUid:(NSString *)uid {
|
||||||
return [self.stageView centerForUserAtUid:uid];
|
return [self.stageView animationPointAtStageViewByUid:uid];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - XPRoomSettingInputViewDelegate
|
#pragma mark - XPRoomSettingInputViewDelegate
|
||||||
@@ -643,7 +643,7 @@ UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
|
|||||||
|
|
||||||
- (XPRoomAnimationView *)animationView {
|
- (XPRoomAnimationView *)animationView {
|
||||||
if (!_animationView) {
|
if (!_animationView) {
|
||||||
_animationView = [[XPRoomAnimationView alloc] initWithdelegate:self];
|
_animationView = [[XPRoomAnimationView alloc] initWithDelegate:self];
|
||||||
}
|
}
|
||||||
return _animationView;
|
return _animationView;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user