我目前无法复制我的应用所需的所有各种导航模式。在尝试一些建议时,我在SwiftUI标头中遇到了三个NavigationLink初始化程序。第一个签名非常常见,但是第二个和第三个初始化程序分别用于什么以及为什么(以及如何)分别使用它们?
谢谢。
/// Creates an instance that presents destination as a detail view.
public init<V>(destination: V, label: () -> Label) where V : View
/// Creates an instance that controls a presentation driven by state.
public init(isPresented: Binding<Bool>, label: () -> Label)
/// Creates an instance that controls a presentation driven by state.
public init<V>(destination: V, in presentedDestination: Binding<V?>, label: () -> Label)