SVPullToRefresh
SVPullToRefresh copied to clipboard
don't use strings for store empty custom views
You save empty view like @"" strings. 0_o
- (void)setCustomView:(UIView *)view forState:(SVPullToRefreshState)state {
id viewPlaceholder = view;
if(!viewPlaceholder)
viewPlaceholder = @"";
if(state == SVPullToRefreshStateAll)
[self.viewForState replaceObjectsInRange:NSMakeRange(0, 3) withObjectsFromArray:@[viewPlaceholder, viewPlaceholder, viewPlaceholder]];
else
[self.viewForState replaceObjectAtIndex:state withObject:viewPlaceholder];
[self setNeedsLayout];
}
It's look copy-paste from
- (void)setSubtitle:(NSString *)subtitle forState:(SVPullToRefreshState)state {
if(!subtitle)
subtitle = @"";
if(state == SVPullToRefreshStateAll)
[self.subtitles replaceObjectsInRange:NSMakeRange(0, 3) withObjectsFromArray:@[subtitle, subtitle, subtitle]];
else
[self.subtitles replaceObjectAtIndex:state withObject:subtitle];
[self setNeedsLayout];
}
AFAIK this is how you set a text label to be blank... [NSNull null] will display "(null)" no?
Why the images?
no, I said it only for custom view
Still don't get it. What's the problem with setting blank strings for custom view?