Comments (1)
Yes, it will be impossible to work in this way.
The Partial Sheet view does know nothing about your Navigation View, therefore the NavigationLink doesn't work.
At the root of your app there is something like this:
ZStack {
NavigationView { YouContentApp }
PartialSheetView { Sheet Content}
}
Therefore the navigation View and The Partial View are totally 2 different branch of your layers tree.
It's like if you want to push a View in you NavigationStack from a Modal View.
Anyway with some code you can turnaround the problem.
This would be one of the solutions:
import PartialSheet
import SwiftUI
struct ContentView: View {
@EnvironmentObject private var partialSheetManager: PartialSheetManager
var body: some View {
NavigationView {
ZStack {
NavigationLink(destination: Text("Destination View"), isActive: $showNextView, label: {EmptyView()})
Button(action: {
self.partialSheetManager.showPartialSheet {
Button(action: {
self.partialSheetManager.isPresented = false
DispatchQueue.main.asyncAfter(deadline: .now() + 0.33) {
self.showNextView = true
}
}) {
Text("Navigation Link")
}
}
}) {
Text("Show Partial Sheet")
}
}
}
.navigationViewStyle(StackNavigationViewStyle())
.addPartialSheet()
}
}
I've updated the examples directory with a brand new example for your case.
Just play the project in your simulator and you will see the result.
from partialsheet.
Related Issues (20)
- iOS 14.x support for 3.0 HOT 1
- PickerExample not working when using .segmented style HOT 3
- Scroll View Extra Bottom Spacing
- [bug maybe] partialsheet will not shown in fullScreenCover page HOT 1
- Wrong safeArea spacing with .sheet
- The sheet disappears when the view is refreshed. HOT 1
- Binding for presenting partialSheet is not updated correctly when tapping fast to dismiss the sheet. HOT 3
- Keyboard doesn't work with dynamic height HOT 3
- Bound preference PresenterPreferenceKey tried to update multiple times per frame. HOT 2
- PartialSheet disappears automatically after Alert is presented
- PartialSheet 3: PSButton action is never called in ListExample
- PartialSheet Crash when using multiple horizontal scroll views HOT 2
- Partial Sheet over tab bar
- The `DragGesture.onEnded(_:)` not be called up. HOT 1
- PartialSheet auto close when openURL in sheet content with `@Environment(\.scenePhase)`
- Could not find module 'PartialSheet' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator HOT 1
- Can't scroll with WKWebView inside the PartialSheet
- TabView over the PartialSheet
- Partial sheet on top of .sheet() gets cut off HOT 1
- How to prevent PartialSheet from closing when clicking on the background or dragging down? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from partialsheet.