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

Update CalendarViewRepresentable methods to have the same signature as corresponding CalendarViewContent methods #271

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

calda
Copy link
Member

@calda calda commented Sep 19, 2023

Details

Inside Airbnb we use the follow protocol to abstract CalendarViewRepresentable and CalendarViewContent behind a single type:

public protocol CalendarContentConfigurable {
  func monthHeaderItemProvider(
    _ monthHeaderItemProvider: @escaping (_ month: Month) -> AnyCalendarItemModel?)
    -> Self
  func dayOfWeekItemProvider(
    _ dayOfWeekItemProvider: @escaping (
      _ month: Month?,
      _ weekdayIndex: Int)
      -> AnyCalendarItemModel?)
    -> Self
  func dayItemProvider(_ dayItemProvider: @escaping (_ day: Day) -> AnyCalendarItemModel?) -> Self
}

extension CalendarViewContent: CalendarContentConfigurable { }

extension CalendarViewRepresentable: CalendarContentConfigurable { }

This requires the two types having the same method signatures, which we changed unintentionally #269.

This PR updates CalendarViewRepresentable to match the changes applied to CalendarViewContent in #269.

@calda calda force-pushed the cal--fix-UIViewRepresentable branch from e079819 to 8d0bb75 Compare September 19, 2023 21:14
@calda calda marked this pull request as ready for review September 19, 2023 21:14
@calda calda requested a review from bryankeller September 19, 2023 21:15
@calda calda merged commit 39e0b3f into master Sep 19, 2023
3 checks passed
@bryankeller bryankeller deleted the cal--fix-UIViewRepresentable branch September 19, 2023 21:36
@bryankeller bryankeller added the enhancement New feature or request label Sep 19, 2023
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