Implemented the StackNavigationViewModifier view modifier for the Browse module.
This commit is contained in:
parent
9b74420ee4
commit
12104f90dd
@ -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()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user