All Projects → lbrndnr → StackNavigationView

lbrndnr / StackNavigationView

Licence: MIT license
A SwiftUI component for macOS that makes complex view hierarchies possible

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to StackNavigationView

KeyboardKitPro
KeyboardKit Pro extends KeyboardKit with pro features.
Stars: ✭ 42 (-56.25%)
Mutual labels:  swiftui
ResponderChain
Cross-platform first responder handling without subclassing views or making custom ViewRepresentables in SwiftUI. Similar to FocusState but for iOS 13+
Stars: ✭ 69 (-28.12%)
Mutual labels:  swiftui
SSSwiftUIGIFView
SSSwiftUIGIFView is a custom controller which helps to load GIF in SwiftUI.
Stars: ✭ 48 (-50%)
Mutual labels:  swiftui
SwiftUI
SwiftUI (WWDC 19)
Stars: ✭ 14 (-85.42%)
Mutual labels:  swiftui
data-field
A SwiftUI view that wraps a text field to only accept specific data.
Stars: ✭ 13 (-86.46%)
Mutual labels:  swiftui
StoreAway
Store away files to destination by filetype.
Stars: ✭ 13 (-86.46%)
Mutual labels:  swiftui
Food-App-UI-by-using-SwiftUI
youtu.be/n4EuMTY3ehc
Stars: ✭ 60 (-37.5%)
Mutual labels:  swiftui
SaveMyEyes
Minimalistic macOS application that helps to take breaks while using the computer
Stars: ✭ 27 (-71.87%)
Mutual labels:  swiftui
telltime
iOS application to tell the time in the British way 🇬🇧⏰
Stars: ✭ 49 (-48.96%)
Mutual labels:  swiftui
tv-maniac
Tv-Maniac is a Multiplatform app (Android & iOS) for viewing TV Shows from TMDB.
Stars: ✭ 55 (-42.71%)
Mutual labels:  swiftui
pareto-mac
Automatically audit your Mac for basic security hygiene.
Stars: ✭ 223 (+132.29%)
Mutual labels:  swiftui
XUI
XUI makes modular, testable architectures for SwiftUI apps a breeze!
Stars: ✭ 100 (+4.17%)
Mutual labels:  swiftui
QuoteKit
A framework to use the free APIs provided by https://quotable.io
Stars: ✭ 17 (-82.29%)
Mutual labels:  swiftui
Router
Router is a library that assists with SwiftUI view transitions.
Stars: ✭ 68 (-29.17%)
Mutual labels:  swiftui
NikeClockIcon
Custom macOS Dock Icon with clock inspired by Nike Watch Face
Stars: ✭ 27 (-71.87%)
Mutual labels:  swiftui
Surround
A modern iOS app for playing Go on the Online Go Server (OGS)
Stars: ✭ 29 (-69.79%)
Mutual labels:  swiftui
SSSwiftUISpinnerButton
SSSwiftUISpinnerButton is a collection of various spinning animations for buttons in SwiftUI.
Stars: ✭ 37 (-61.46%)
Mutual labels:  swiftui
VCore
VCore is a Swift collection containing objects, functions, and extensions that I use for my projects
Stars: ✭ 32 (-66.67%)
Mutual labels:  swiftui
swift-identified-collections
A library of data structures for working with collections of identifiable elements in an ergonomic, performant way.
Stars: ✭ 247 (+157.29%)
Mutual labels:  swiftui
swiftui-example
SwiftUI 示例,技巧和技术集合,帮助我构建应用程序,解决问题以及了解SwiftUI的实际工作方式。
Stars: ✭ 109 (+13.54%)
Mutual labels:  swiftui

StackNavigationView

Twitter: @lbrndnr License

About

As of SwiftUI v2, NavigationView only supports a simple sidebar selection. This makes it impossible to push new views onto the view hierarchy, as one could do e.g. with UINavigationController. This project is a workaround that builds upon NavigationView to support complex view hierarchies.

Demo

Usage

The interface of StackNavigationView is very similar to the one of NavigationView, just make sure not to use NavigationLink inside of StackNavigationView though, it will result in undefined behaviour. You'll find the full example here.

struct ContentView: View {

@State private var selection: Int? = 0

var body: some View {
    
    return StackNavigationView(selection: $selection) {
        List {
            SidebarNavigationLink("Apples", destination: rootView(title: "Apples"), tag: 0, selection: $selection)
            SidebarNavigationLink("Bananas", destination: rootView(title: "Bananas"), tag: 1, selection: $selection)
            SidebarNavigationLink("Clementines", destination: rootView(title: "Clementines"), tag: 2, selection: $selection)
        }
        Text("Empty Selection")
    }
    .frame(minWidth: 600, minHeight: 400)
}

@ViewBuilder private func rootView(title: String) -> some View {
    VStack {
        Text("This is the root view of \(title)")
            .font(.system(size: 50))
            .bold()
        Spacer()
            .frame(height: 40)
        StackNavigationLink("Next", destination: ChildView(sidebar: title, level: 1))
    }
    .padding(20)
    .navigationTitle(title)
}
}

Requirements

StackNavigationView is a SwiftUI component for macOS. macOS Big Sur is required.

Author

I'm Laurin Brandner, I'm on Twitter.

License

StackNavigationView is licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].