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

Add view builder closures for custom views #268

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

bryankeller
Copy link
Contributor

@bryankeller bryankeller commented Sep 18, 2023

Details

This adds new APIs to CalendarViewRepresentable for customizing the day views, month header views, etc. These new APIs allow developers to work with SwiftUI view directly, without needing to convert to a CalendarItemModel<SwiftUIWrapperView> first.

As of right now, most of the SwiftUI support is undocumented in the README. I'll be working on revamping the docs next.

Related Issue

N/A

Motivation and Context

More idiomatic SwiftUI API.

How Has This Been Tested

Example app.

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 Sep 18, 2023
@@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added a `multiDaySelectionDragHandler`, enabling developers to implement multiple-day-selection via a drag gesture (similar to multi-select in the iOS Photos app)
- Added the ability to change the aspect ratio of individual day-of-the-week items
- Added support for self-sizing month headers
- Added a new `setContent(_:animated:)` function, allowing people to perform animated content updates
- Added a new `setContent(_:animated:)` function, enabling developers to perform animated content updates
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Head Lead of Developer Enablement

brynbodayle
brynbodayle previously approved these changes Sep 18, 2023
@bryankeller bryankeller force-pushed the bk/improve-swiftui-api branch from a123e20 to c16beff Compare September 18, 2023 14:59
@bryankeller bryankeller merged commit 7f237b5 into master Sep 18, 2023
2 checks passed
@bryankeller bryankeller deleted the bk/improve-swiftui-api branch September 18, 2023 15:08
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