Implemented the StackNavigationViewModifier view modifier for the Browse module.

This commit is contained in:
Javier Cicchelli 2022-12-14 23:59:33 +01:00
parent 9b74420ee4
commit 12104f90dd

View File

@ -0,0 +1,36 @@
//
// 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()
}
)
}
}