Skip to content

Conversation

@kvyatkovskys
Copy link
Owner

Updates the calendar view to use autolayout for flexible size adjustments. The initializer is simplified and the frame is not directly set, allowing autolayout to handle sizing. The timeline view is also updated to use safe area layout guide for bottom constraint.

Updates the calendar view to use autolayout for flexible size adjustments.
The initializer is simplified and the frame is not directly set, allowing autolayout to handle sizing.
The timeline view is also updated to use safe area layout guide for bottom constraint.
@kvyatkovskys kvyatkovskys requested a review from Copilot May 31, 2025 20:09
@kvyatkovskys kvyatkovskys self-assigned this May 31, 2025
@kvyatkovskys kvyatkovskys added bug Something isn't working enhancement New feature or request labels May 31, 2025

This comment was marked as outdated.

Removes the SwiftUI example implementation from the project.
The example is no longer needed or maintained, and its removal simplifies the project structure.

Updates the default selected controller in SceneDelegate.
Updates event dates in example json.
Renames ViewController to KVKCalendarVC and adjusts associated files, including the project file and scene delegate, to streamline the example app structure and improve clarity.

Updates the example app to initialize the calendar view controller with a flag indicating whether it's being presented from SwiftUI, and adjusts UI setup accordingly.

Improves data fetching by implementing async loading of events with an optional delay and updates the UI on the main actor.
@kvyatkovskys kvyatkovskys requested a review from Copilot June 2, 2025 09:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors the calendar view layout and initialization to leverage Auto Layout and safe area guides while simplifying initializer usage for improved flexibility. Key changes include updating content size calculation and constraints in TimelineView, streamlining convenience initializers in KVKCalendarView, and revising SwiftUI example integration.

Reviewed Changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Sources/KVKCalendar/TimelineView.swift Replaces manual height calculation with a bottom offset and updates content size calculation for Auto Layout.
Sources/KVKCalendar/Timeline+Extension.swift Changes bottom constraint to use safeAreaLayoutGuide for improved UI adaptation.
Sources/KVKCalendar/KVKCalendarView.swift Simplifies initializer signatures; adopts default .zero frames and updates layoutIfNeeded override.
Sources/KVKCalendar/KVKCalendarView+Extension.swift Updates left/right constraints to leading/trailing for better i18n support.
Sources/KVKCalendar/DayPadCell.swift Adjusts the horizontal positioning of the date view from 50% to 52% of the frame’s width.
Sources/KVKCalendar/DayCell.swift Modifies the default height for date display from 35 to 30.
Sources/KVKCalendar/Calendar+Extension.swift Simplifies platform interface logic by directly returning the current device.
README.md Updates SwiftUI usage examples and renames classes to reflect the refactored implementation.
Example files (SceneDelegate, KVKCalendarVC, etc.) Update root view controllers, event dates, and project configurations to match the new calendar view structure.
Example project configurations Updates Xcode schemes and project settings to align with new version numbers and identifiers.
Files not reviewed (1)
  • Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/KVKCalendar.xcscheme: Language not supported
Comments suppressed due to low confidence (1)

Sources/KVKCalendar/KVKCalendarSettings.swift:85

  • Ensure that all callers of this asynchronous loadEvents function are updated to handle the new async/await pattern, replacing the previous callback approach.
func loadEvents(dateFormat: String, withDelay: Bool = true) async -> [Event] {

This commit introduces a `ScrollWeekView` implemented in SwiftUI.

The `ScrollWeekView` provides a scrollable week calendar view, allowing users to navigate through different weeks.

It uses `ScrollableWeekView` internally and provides a SwiftUI-compatible wrapper for easy integration.
Refactors code for better performance and responsiveness, especially on iPad devices.

Adds `@MainActor` to several methods and properties to ensure UI updates are performed on the main thread, preventing potential concurrency issues.

Updates ScrollableWeekView to accept an optional style to allow for more flexibility in how the view is configured.

Modifies `loadEvents` to accept a `Style` object instead of a date format string, using the style's time format to load events.

Fixes a layout issue in SwiftUI where the calendar view was not properly ignoring safe area insets.
@kvyatkovskys kvyatkovskys marked this pull request as ready for review August 4, 2025 07:12
Removes device-specific font variations for year view week and day titles.

This change simplifies the style configuration by using a single font property for both week and day titles in the year view, instead of having separate fonts for iPad and iPhone. It removes the platform check and consolidates the font definitions, leading to cleaner and more maintainable code. Also the minimum scale factor is changed from 0.6 to 0.3 in WeekHeaderView.

Updates the project configuration.
Allows the calendar view to be initialized and updated with a frame when not using auto layout.

This change ensures correct layout behavior in environments where auto layout is not preferred or available.
@kvyatkovskys kvyatkovskys merged commit a610f65 into master Nov 2, 2025
@kvyatkovskys kvyatkovskys deleted the feature/v_0.6.30_v2 branch November 2, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Readme is outdated SwiftUI Week Configuration Incorrect positioning of calendar with AutoLayout

2 participants