Add method for checking date visibility. Improve scrolling method to consider if header is pinned.#21
Open
randomstep wants to merge 3 commits intopuls:masterfrom
Open
Add method for checking date visibility. Improve scrolling method to consider if header is pinned.#21randomstep wants to merge 3 commits intopuls:masterfrom
randomstep wants to merge 3 commits intopuls:masterfrom
Conversation
Owner
|
Check your indentation. |
Author
|
Fixed. |
Owner
There was a problem hiding this comment.
Not sure how I feel about this particular change, as it represents a break from backwards compatibility. Are you using a calendar view that's not big enough to display the whole month at once?
Author
There was a problem hiding this comment.
I am, yes. I think deferring to "pinsHeaderToTop" makes consistent and expected behavior. Otherwise "scrollToDate" is just "scrollToMonth". I can see how it wouldn't matter so much if you display the whole month.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.