objc-TimesSquare
objc-TimesSquare copied to clipboard
Add method for checking date visibility. Improve scrolling method to consider if header is pinned.
I wanted to check if a date is already displayed, so I know whether to scroll to it, or for example to hide the calendar if it is already in view.
I also wanted the scrolling to actually show the date itself, not just the month. So I made both my new method and the scrolling method check for pinning, and go to the exact row or the section based on whether header pinning is turned on.
Suggestions for refactoring out the duplicate code for checking pinsHeaderToTop? It bugs me but so does adding something like pinnedIndexPathForRowAtDate:. Could also do indexPathForRowAtDate:IgnorePinning: where the second argument is a BOOL on whether to use pinning or not. Or maybe is whether to return the header row for the month instead of the exact row. That doesn't seem like a great solution either.
Check your indentation.
Fixed.