objc-TimesSquare icon indicating copy to clipboard operation
objc-TimesSquare copied to clipboard

Add method for checking date visibility. Improve scrolling method to consider if header is pinned.

Open randomstep opened this issue 12 years ago • 2 comments

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.

randomstep avatar Mar 29 '13 01:03 randomstep

Check your indentation.

puls avatar Apr 17 '13 15:04 puls

Fixed.

randomstep avatar Apr 21 '13 15:04 randomstep