This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UI][Core] - fix comment for TTDeprecation and Fix for TTTableViewHea…
…der disappearing on reuse. Closes #408
- Loading branch information
Showing
2 changed files
with
7 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,12 @@ - (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger) | |
NSString* title = [tableView.dataSource tableView:tableView titleForHeaderInSection:section]; | ||
if (title.length > 0) { | ||
TTTableHeaderView* header = [_headers objectForKey:title]; | ||
if (nil == header) { | ||
// If retrieved from cache, prepare for reuse: | ||
// We reset the the opacity to 1, UITableView could set this property to 0 after remove it. | ||
This comment has been minimized.
Sorry, something went wrong. |
||
if (header) { | ||
This comment has been minimized.
Sorry, something went wrong.
jverkoey
Contributor
|
||
header.alpha = 1; | ||
} | ||
else if (nil == header) { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
if (nil == _headers) { | ||
_headers = [[NSMutableDictionary alloc] init]; | ||
} | ||
|
I'm not sold that this is the safest solution to this problem. Can we add some form of a
prepareForReuse
method to theTTTableHeaderView
? This will allow any subclasses of the header view to handle their own reuse properly.