my-files-sample/Modules/Sources/Browse/UI/View Modifiers/StackNavigationViewModifier.swift

38 lines
771 B
Swift
Raw Normal View History

//
// StackNavigationViewModifiers.swift
// Browse
//
// Created by Javier Cicchelli on 14/12/2022.
// Copyright © 2022 Röck+Cöde. All rights reserved.
//
import SwiftUI
struct StackNavigationViewModifier<Destination: View>: ViewModifier {
// MARK: Properties
let tag: Stack
@Binding var stack: Stack?
@ViewBuilder var destination: Destination
// MARK: Functions
func body(content: Content) -> some View {
content
.background(
NavigationLink(
destination: destination,
tag: tag,
selection: $stack
) {
EmptyView()
}
.hidden()
)
}
}