Skip to content

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

License

Notifications You must be signed in to change notification settings

simonnickel/snap-matching-navigation

Repository files navigation

Caution

This repository no longer active, it was replaced by snap-navigation.

This package is part of the SNAP suite.

// TODO: Replace with WWDC24 TabView

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