Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonnickel/snap-matching-navigation
A SwiftUI Container that displays a TabView or SplitScene, based on the device.
https://github.com/simonnickel/snap-matching-navigation
navigation swift swift-ui swiftui
Last synced: about 2 months ago
JSON representation
A SwiftUI Container that displays a TabView or SplitScene, based on the device.
- Host: GitHub
- URL: https://github.com/simonnickel/snap-matching-navigation
- Owner: simonnickel
- License: mit
- Created: 2024-04-15T10:08:04.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-10-09T18:15:53.000Z (3 months ago)
- Last Synced: 2024-11-17T17:35:42.104Z (about 2 months ago)
- Topics: navigation, swift, swift-ui, swiftui
- Language: Swift
- Homepage:
- Size: 356 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fsimonnickel%2Fsnap-matching-navigation%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/simonnickel/snap-matching-navigation)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fsimonnickel%2Fsnap-matching-navigation%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/simonnickel/snap-matching-navigation)> This package is part of the [SNAP](https://github.com/simonnickel/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][documentation badge]][documentation]
[documentation]: https://swiftpackageindex.com/simonnickel/snap-matching-navigation/main/documentation/snapmatchingnavigation
[documentation badge]: https://img.shields.io/badge/Documentation-DocC-blue## Demo
The [demo project](/SnapMatchingNavigationDemo) 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
})
})
```### 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.