添加侧边栏

This commit is contained in:
2026-02-03 16:54:38 +08:00
parent a0923c8572
commit b9663037f5
16 changed files with 728 additions and 2 deletions

View File

@@ -0,0 +1,51 @@
//
// KBAIPersonaSidebarView.h
// keyBoard
//
// Created by Codex on 2026/2/3.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class KBPersonaModel;
@class KBAIPersonaSidebarView;
@protocol KBAIPersonaSidebarViewDelegate <NSObject>
@optional
/// 侧边栏请求人设数据
/// page 从 1 开始
- (void)personaSidebarView:(KBAIPersonaSidebarView *)view
requestPersonasAtPage:(NSInteger)page;
/// 选择某个人设
- (void)personaSidebarView:(KBAIPersonaSidebarView *)view
didSelectPersona:(KBPersonaModel *)persona;
@end
/// 人设侧边栏LSTPopView 内容视图)
@interface KBAIPersonaSidebarView : UIView
@property (nonatomic, weak) id<KBAIPersonaSidebarViewDelegate> delegate;
@property (nonatomic, assign) NSInteger selectedPersonaId;
@property (nonatomic, assign, readonly) NSInteger currentPage;
/// 更新人设列表
/// reset=YES 表示重置并替换数据reset=NO 表示追加
/// currentPage 为当前已加载页数(从 1 开始)
- (void)updatePersonas:(NSArray<KBPersonaModel *> *)personas
reset:(BOOL)reset
hasMore:(BOOL)hasMore
currentPage:(NSInteger)currentPage;
/// 请求数据(若为空)
- (void)requestPersonasIfNeeded;
/// 更新选中态
- (void)updateSelectedPersonaId:(NSInteger)personaId;
/// 结束加载更多
- (void)endLoadingMore;
/// 重置加载更多状态
- (void)resetLoadMore;
@end
NS_ASSUME_NONNULL_END