Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeloper committed Dec 26, 2020
1 parent e07587e commit aefc749
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Sources/NavigationKit/ButtonAsRootNavigationLink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ import SwiftUI
@available(iOS 13.0, *)
public struct ButtonAsRootNavigationLink<Destination: View, Content: View>: View {
public let destination: Destination
public let content: Content
public let content: () -> Content

public var isActive: Binding<Bool>
@Binding public var isActive: Bool

public init(destination: Destination, @ViewBuilder content: () -> Content, isActive: Binding<Bool>) {
self.destination = destination
self.content = content()
self.isActive = isActive
}
// public init(destination: Destination, @ViewBuilder content: () -> Content, isActive: Binding<Bool>) {
// self.destination = destination
// self.content = content()
// self.isActive = isActive
// }

public var body: some View {
Button(action: {
isActive.wrappedValue = true
}, label: { content })
isActive = true
}, label: { content() })
.background(
NavigationLink(
destination: destination,
isActive: isActive,
isActive: $isActive,
label: { EmptyView() }
).isDetailLink(false).hidden()
)
Expand Down

0 comments on commit aefc749

Please sign in to comment.