Skip to content

Commit 6367f61

Browse files
committed
Prepare for release
1 parent ea6c939 commit 6367f61

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,27 @@ If you have a **self-satisfied** cell, then all you have to do is:
2525

2626
## Height Caching API
2727

28-
Since iOS8, `-tableView:heightForRowAtIndexPath:` will be called more times than we expect, we can feel these extra calculations when scrolling. So we provide another API with caches:
28+
Since iOS8, `-tableView:heightForRowAtIndexPath:` will be called more times than we expect, we can feel these extra calculations when scrolling. So we provide another API with cache by index path:
2929

3030
``` objc
31-
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
32-
{
31+
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
3332
return [tableView fd_heightForCellWithIdentifier:@"identifer" cacheByIndexPath:indexPath configuration:^(id cell) {
3433
// configurations
3534
}];
3635
}
3736
```
3837

39-
### Auto cache invalidation
40-
41-
Extra calculations will be saved if a height at an index path has been cached, besides, **NO NEED** to worry about invalidating cached heights when data source changes, it will be done **automatically** when you call "-reloadData" or any method that triggers UITableView's reloading.
38+
Or, if your entity has an unique identifier, use cache by key API:
4239

43-
## Precache
44-
45-
Pre-cache is an advanced function which helps to cache the rest of offscreen UITableViewCells automatically, just in **"idle"** time. It helps to improve scroll performance, because no extra height calculating will be used when scrolls. It's enabled by default if you use "fd_heightForCellWithIdentifier:cacheByIndexPath:configuation:" API.
46-
47-
## About estimatedRowHeight
48-
`estimatedRowHeight` helps to delay all cells' height calculation from load time to scroll time. Feel free to set it or not when you're using FDTemplateLayoutCell. If you use "cacheByIndexPath" API, setting this estimatedRowHeight property is a better practice for imporve load time, and it **DOES NO LONGER** affect scroll performance because of "precache".
4940
``` objc
50-
self.tableView.estimatedRowHeight = 200;
41+
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
42+
Entity *entity = self.entities[indexPath.row];
43+
return [tableView fd_heightForCellWithIdentifier:@"identifer" cacheByKey:entity.uid configuration:^(id cell) {
44+
// configurations
45+
}];
46+
}
5147
```
48+
5249
## Frame layout mode
5350

5451
`FDTemplateLayoutCell` offers 2 modes for asking cell's height.
@@ -64,8 +61,7 @@ cell.fd_enforceFrameLayout = YES;
6461
And if you're using frame layout mode, you must override `-sizeThatFits:` in your customized cell and return content view's height (separator excluded)
6562

6663
```
67-
- (CGSize)sizeThatFits:(CGSize)size
68-
{
64+
- (CGSize)sizeThatFits:(CGSize)size {
6965
return CGSizeMake(size.width, A+B+C+D+E+....);
7066
}
7167
```
@@ -119,7 +115,7 @@ A template layout cell is created by `-dequeueReusableCellWithIdentifier:` metho
119115

120116
## Installation
121117

122-
Latest version: **1.3**
118+
Latest version: **1.4.beta**
123119

124120
```
125121
pod search UITableView+FDTemplateLayoutCell
@@ -134,6 +130,9 @@ pod setup
134130

135131
We recommend to use the latest release in cocoapods.
136132

133+
- 1.4
134+
Refactor, add "cacheByKey" mode, bug fixed
135+
137136
- 1.3
138137
Frame layout mode, handle cell's accessory view/type
139138

UITableView+FDTemplateLayoutCell.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Pod::Spec.new do |s|
33
s.name = "UITableView+FDTemplateLayoutCell"
4-
s.version = "1.3"
4+
s.version = "1.4.beta"
55
s.summary = "Template auto layout cell for automatically UITableViewCell height calculate, cache and precache"
66
s.description = "Template auto layout cell for automatically UITableViewCell height calculate, cache and precache. Requires a `self-satisfied` UITableViewCell, using system's `- systemLayoutSizeFittingSize:`, provides heights caching."
77
s.homepage = "https://github.com/forkingdog/UITableView-FDTemplateLayoutCell"
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
1313
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
1414
s.platform = :ios, "6.0"
1515
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
16-
s.source = { :git => "https://github.com/forkingdog/UITableView-FDTemplateLayoutCell.git", :tag => "1.3" }
16+
s.source = { :git => "https://github.com/forkingdog/UITableView-FDTemplateLayoutCell.git", :tag => "1.4.beta" }
1717
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
1818
s.source_files = "Classes/*.{h,m}"
1919
# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #

0 commit comments

Comments
 (0)