Skip to content

simonnickel/snap-matching-navigation

Repository files navigation

This package is part of the SNAP suite.

SnapMatchingNavigation

Matching Navigation provides a SwiftUI container view that displays a TabView or SplitScene, based on the device.

Documentation

Demo

The demo project shows an example on how to use the package.

How to use

MNavContainer(splitScene: {
	NavigationSplitView {
		Text("Sidebar")
	} content: {
		Text("Content")
	} detail: {
		Text("Detail")
	}
}, tabScene: {
	MNavTabScene(tabs: tabs, selected: $tabSelected, tabScreen: { tab in
		
		<View for the tab>
		
	})
})

MNavContainer

A container that either shows the SplitScene or the TabScene ViewBuilder based on device.

MNavTabScene

A wrapper around TabView to expose the selected tab as a binding.

About

A SwiftUI Container that displays a TabView or SplitScene, based on the device.

Topics

Resources

License

Stars

Watchers

Forks

Languages