samvermette/SVPullToRefresh — pull request #140 by pingwinator (2013-07-12 12:25:13+00:00)
Title: 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];
}