BBAGroupedList.h
1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// BBAGroupedList.h
// BBAPods
//
// Created by Feng on 30/03/2016.
// Copyright © 2016 Baidu. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface BBAGroupedList : NSObject
/**
* 自定义的集合类型,只能通过拼音排序,不够抽象,很难被业务方复用
* wiki:
*/
- (instancetype)initWithItems:(NSArray *)itmes;
- (NSArray *)items;
- (NSInteger)count;
- (NSInteger)numberOfSections;
- (NSInteger)numberOfRowsInSection:(NSInteger)section;
- (NSString *)titleForSeciton:(NSUInteger)section;
- (NSArray *)titles;
- (id)itemAtIndexPath:(NSIndexPath *)indexPath;
- (NSArray *)itemsWithPattern:(NSString *)pattern;
- (NSIndexPath *)indexPathForItem:(id)item;
- (void)removeItem:(id)item
completion:(void(^)(NSIndexPath *indexPath, BOOL shouldRemoveSection))completion;
- (void)insertItem:(id)item
completion:(void(^)(NSIndexPath *indexPath, BOOL shouldInsertSection))completion;
// 需重载
- (NSString *)nameForItem:(id)item;
- (NSPredicate *)predicateWithPattern:(NSString *)pattern;
@end