SVPullToRefresh icon indicating copy to clipboard operation
SVPullToRefresh copied to clipboard

update example with custom title and subtitle

Open emichaud opened this issue 12 years ago • 3 comments

Hi, thanks so much for this library. would it be possible to update your example to show how to add custom title and subtitle?

I'd like to add a subtitle that adds "Last refresh date:some-date".

I've tried using the setter methods setTitle, setSubtitle but am not having any luck. Oddly enough, they don't seem to be called, even though I'm calling them unless I call them from the action handler. I've tried to call them from my vc directly as well in my action block but no luck.

Note: this modification to the library works allows the method to work for setting the subtitle from my vc:

  • (void)setSubtitle:(NSString *)subtitle forState:(SVPullToRefreshState)state { self.showsDateLabel = YES; //modified line (set to NO in init) .... }

Also - this still does not show the subtitle until it is run once. This produces the last refresh subtitle I would like, however, it does not show on first run. I'd like to also be able to set last refresh before they actually trigger a refresh. Is this possible?

any help would be appreciated. thanks!

emichaud avatar Oct 29 '12 15:10 emichaud

Sorry, there was a bug that was preventing the setters from working properly. Fixed with my last commit.

samvermette avatar Oct 30 '12 05:10 samvermette

not fixed

vargarobert avatar May 28 '13 10:05 vargarobert

not fixed.

seandeng avatar Feb 26 '15 16:02 seandeng