Skip to content

fullScreenCover style added for iOS 14+#18

Merged
diniska merged 11 commits intovoidfrom
denis/full-screen-cover
Jan 25, 2026
Merged

fullScreenCover style added for iOS 14+#18
diniska merged 11 commits intovoidfrom
denis/full-screen-cover

Conversation

@diniska
Copy link
Owner

@diniska diniska commented Jan 24, 2026

No description provided.

Copy link
Contributor

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 PR adds support for configuring the presentation style of modal views, enabling fullScreenCover where available while maintaining backward compatibility with existing sheet-based behavior.

Changes:

  • Introduces ModalViewPresentationStyle and a View.modalViewPresentationStyle(_:) helper, plus associated environment plumbing.
  • Refactors ModalPresenter into platform/OS-version–aware modifiers, and updates ModalLink to honor the configured presentation style by routing to sheet or fullScreenCover on supported platforms.
  • Updates documentation in README.md to describe styling options and fixes a minor grammatical issue.

Reviewed changes

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

File Description
Sources/ModalView/ModalViewPresentationStyle.swift Defines the ModalViewPresentationStyle enum and environment-based API to let views choose between sheet and fullScreenCover, with a default and compatibility fallback.
Sources/ModalView/ModalView.swift Adapts ModalPresenter to use distinct modifiers for pre‑ and post‑iOS 14, extends the modal pipeline to carry a ModalViewPresentationStyle, and updates ModalLink to read the style from the environment and present accordingly.
README.md Documents the available presentation styles and clarifies wording in the usage section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +72 to +81
@available(iOS 14, tvOS 14, watchOS 7, *)
@available(macOS, unavailable)
private struct ModalPresenterIOS14: ViewModifier {
@ObservedObject private var modalView = Pipe()

public var body: some View {
func body(content: Content) -> some View {
content
.environmentObject(modalView)
.sheet(item: $modalView.content, content: { $0.view })
.sheet(item: $modalView.sheetContent, content: { $0.view })
.fullScreenCover(item: $modalView.fullScreenCoverContent, content: { $0.view })
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

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

The new ModalPresenterIOS14 modifier and ModalViewPresentationStyle environment-based switching between .sheet and .fullScreenCover are not covered by tests, even though ModalPresenter and ModalLink already have snapshot tests; adding tests that validate the behavior when the presentation style is changed (and that legacy platforms still fall back to .sheet) would help prevent regressions.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@diniska diniska merged commit 0fe06a5 into void Jan 25, 2026
1 check passed
@diniska diniska deleted the denis/full-screen-cover branch January 25, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants