Skip to content

Add custom screen presentation styles #51

@ohitsdaniel

Description

@ohitsdaniel

Idea

Currently, we only support two screen presentation styles: push and sheet. We could add a way to define custom screen presentation styles.

Problem description

Custom screen presentation styles are a bit tricky as they involve local state for animation. SwiftUI defines animations on a view basis and we could come up with something along the lines of

protocol ScreenTransition: Hashable {
  func animatedContent<Content: View>(content: Content, isVisible: Bool) -> some View
}

struct FullScreenCoverTransition: ScreenTransition {
   func animatedContent<Content: View>(content: Content, isVisible: Bool) -> some View {
    content
      .animationModifiers() // do whatever you want here 
  }
}

We would then need to plug this into NavigationNode and make sure that we properly perform the animation on show and dismiss.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions