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 custom screen presentation styles #51

Open
ohitsdaniel opened this issue Mar 2, 2021 · 0 comments
Open

Add custom screen presentation styles #51

ohitsdaniel opened this issue Mar 2, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@ohitsdaniel
Copy link
Contributor

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.

@ohitsdaniel ohitsdaniel added the enhancement New feature or request label Mar 2, 2021
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

No branches or pull requests

1 participant