Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bk/self sizing month headers #252

Merged
merged 3 commits into from
Aug 3, 2023
Merged

Conversation

bryankeller
Copy link
Contributor

Details

This adds support for self-sizing month headers. I still need to add unit tests in a follow-up PR. Want to unblock some Airbnb dev first though.

Related Issue

N/A

Motivation and Context

Prior to this change, all month headers would have the same height as the first month header in the calendar. This could cause things to break if you later scrolled to a month header that needed 2 lines of text, for example.

How Has This Been Tested

Example project, horizontal and vertical calendar, SwiftUI and UIKit

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@bryankeller bryankeller added the enhancement New feature or request label Aug 3, 2023
// MARK: - VisibleMonthHeaderHeightTracker

/// Calculates heights for month headers by self-sizing views on the fly. Sizing views are reused to prevent unnecessary view allocations.
final class VisibleMonthHeaderHeightTracker {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on unit tests for this now

brynbodayle
brynbodayle previously approved these changes Aug 3, 2023
@bryankeller bryankeller merged commit d79a9c2 into master Aug 3, 2023
2 checks passed
@bryankeller bryankeller deleted the bk/self-sizing-month-headers branch August 3, 2023 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants