Skip to content

Commit 5a3f9be

Browse files
committed
update README to Version 1.1
1 parent 422d99a commit 5a3f9be

File tree

1 file changed

+61
-11
lines changed

1 file changed

+61
-11
lines changed

README.md

Lines changed: 61 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,85 @@ The design was originated from [Aurélien Salomon](https://dribbble.com/aurelien
1919
This navigation interactive mode can make you easier to switch among different boards, while disturbing you the least when you are switching.
2020

2121
## Version
22-
1.0
22+
1.1
2323

2424
## Environment
2525
iOS 8.0 以上 iPhone 5s/iPhone6/iPhone6 Plus 测试通过
2626
iOS 8.0 Above iPhone 5s/6/6 Plus Tested
2727
## Usage
2828

29-
初始化十分简单,但是整个控件需要接受的数据比较复杂,都是自定义的数据模型。
30-
31-
The initialization is very simple, you need to pass over the whole data source to the view, which all have specific data structure.
29+
初始化整个控件比较简单:
3230

3331
```Objective-C
32+
// 初始化其实只要一句话的
33+
self.trelloView = [[TrelloView alloc]initWithFrame:CGRectMake(0.0f, 0.0f, ScreenWidth, ScreenHeight) dataSource:self];
3434

35-
TrelloListCellItem *cell_item_1 = [[TrelloListCellItem alloc] initWithContent:@"Have a pleasant afternoon" image:[UIImage imageNamed:@"testImage3"] type:SCTrelloCellItemRed];
35+
[self.view addSubview:_trelloView];
36+
```
3637
37-
TrelloListItem *item = [[TrelloListItem alloc]initWithTitle:@"BACKLOG" level:3 rowNumber:3 rowItems:t_array];
38+
数据源的加载改为了通过协议的方式完成,你需要总共实现以下这么几条协议:
39+
You should conform to the protocol and implement methods below:
3840
39-
// 初始化其实只要一句话的
40-
TrelloView *trelloView = [[TrelloView alloc]initWithFrame:CGRectMake(0.0f, 0.0f, ScreenWidth, ScreenHeight) listArray:@[item]];
41+
```Objective-C
42+
/**
43+
* Return how many boards that you are going to display
44+
*
45+
* @param trelloView target trelloView
46+
*
47+
* @return NSInteger
48+
*/
49+
- (NSInteger)numberForBoardsInTrelloView:(TrelloView *)trelloView;
50+
51+
/**
52+
* Return how many rows each board is going to display
53+
*
54+
* @param trelloView target trelloView
55+
* @param index index of the target trelloView
56+
*
57+
* @return NSInteger
58+
*/
59+
- (NSInteger)numberForRowsInTrelloView:(TrelloView *)trelloView atBoardIndex:(NSInteger)index;
60+
61+
/**
62+
* Return the item that each row in each board is going to display.
63+
* You can extend the TrelloListCellItem model to whatever you want, just customizing your own cell in table view datasource
64+
* Enjoy yourself :)
65+
*
66+
* @param trelloView target trelloView
67+
* @param index index of the target trelloView
68+
* @param rowIndex index of the target row
69+
*
70+
* @return TrelloListCellItem
71+
*/
72+
- (TrelloListCellItem *)itemForRowsInTrelloView:(TrelloView *)trelloView atBoardIndex:(NSInteger)index atRowIndex:(NSInteger)rowIndex;
73+
74+
/**
75+
* Return title of each board
76+
*
77+
* @param trelloView target trelloView
78+
* @param index index of the target trelloView
79+
*
80+
* @return NSInteger
81+
*/
82+
- (NSString *)titleForBoardsInTrelloView:(TrelloView *)trelloView atBoardIndex:(NSInteger)index;
83+
84+
/**
85+
* Return the level of each board
86+
*
87+
* @param trelloView target trelloView
88+
* @param index index of the target trelloView
89+
*
90+
* @return SCTrelloBoardLevel
91+
*/
92+
- (SCTrelloBoardLevel)levelForRowsInTrelloView:(TrelloView *)trelloView atBoardIndex:(NSInteger)index;
4193
```
42-
具体的初始化可以看demo中的示范,由于初始化的时候需要将整个view的数据源都传入,所以代码比较多。
4394

44-
You can download the demo to see detailed code for initialization.
95+
新版本还提供了一个`reloadData`的方法用来动态刷新数据源。具体的用法可以参考demo和源代码。
4596

4697
## To Do
4798

4899
* CocoaPods
49100
* TableView reusable
50-
* Document
51101

52102

53103

0 commit comments

Comments
 (0)