pronebird / UIScrollView-InfiniteScroll

UIScrollView ∞ scroll category
MIT License
1.06k stars 148 forks source link

Implemented the setting of a custom indicator #3

Closed nsleader closed 9 years ago

nsleader commented 9 years ago

Added setInfiniteIndicatorView: method

pronebird commented 9 years ago

Hi @nsleader,

I looked at the new demo with custom spinner and it looks awesome! :+1:

Some parts of code use space indentation, original source used tabs, but this is something I'll clean up myself.

I'll merge it shortly. Thanks for your contribution!

On the side note. I was thinking of maybe calling startAnimating and stopAnimating selectors on custom view if they exist to match with UIActivityIndicatorView interface and let custom views to actually control animation.

Certainly we can adopt some protocol to make it clear that we use those selectors but I'd like to avoid that for the time being to keep code base shorter.

nsleader commented 9 years ago

I thought about adding a Protocol with startAnimating and stopAnimating methods, but decided that for the first pull request will be too many changes.

I would be very grateful for a speedy change the version in Cocoapods. Thank you!

pronebird commented 9 years ago

Would make sense to introduce protocol in 0.5.0 because CABasicAnimation will be removed when app goes in background or view gets offscreen.

pronebird commented 9 years ago

Hey, I pushed 0.5.1 to CocoaPods, should be there shortly.

I played with custom protocol but then realized that UIImageView and UIActivityIndicatorView both implement startAnimating and stopAnimating and do not have any protocol that defines that convention.

So I keep the same convention for InfiniteScroll too without formal protocol. I documented this behavior in README and CocoaDocs.

Besides that, I wrapped your custom indicator into UIImageView subclass, looks pretty neat: https://github.com/pronebird/UIScrollView-InfiniteScroll/blob/master/InfiniteScrollViewDemo/CustomInfiniteIndicator.m

Thanks again, Bye.