You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-16Lines changed: 15 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -25,30 +25,27 @@ If you have a **self-satisfied** cell, then all you have to do is:
25
25
26
26
## Height Caching API
27
27
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:
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:
42
39
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".
And if you're using frame layout mode, you must override `-sizeThatFits:` in your customized cell and return content view's height (separator excluded)
65
62
66
63
```
67
-
- (CGSize)sizeThatFits:(CGSize)size
68
-
{
64
+
- (CGSize)sizeThatFits:(CGSize)size {
69
65
return CGSizeMake(size.width, A+B+C+D+E+....);
70
66
}
71
67
```
@@ -119,7 +115,7 @@ A template layout cell is created by `-dequeueReusableCellWithIdentifier:` metho
119
115
120
116
## Installation
121
117
122
-
Latest version: **1.3**
118
+
Latest version: **1.4.beta**
123
119
124
120
```
125
121
pod search UITableView+FDTemplateLayoutCell
@@ -134,6 +130,9 @@ pod setup
134
130
135
131
We recommend to use the latest release in cocoapods.
Copy file name to clipboardExpand all lines: UITableView+FDTemplateLayoutCell.podspec
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
2
2
Pod::Spec.newdo |s|
3
3
s.name="UITableView+FDTemplateLayoutCell"
4
-
s.version="1.3"
4
+
s.version="1.4.beta"
5
5
s.summary="Template auto layout cell for automatically UITableViewCell height calculate, cache and precache"
6
6
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."
0 commit comments