Contents

southkin/hiernav

A view that automatically configures NavigationSplitView or NavigationStack based on platform and layout conditions.

HierNav

HierNav(style: <#style#>) {
    <#contents#> //your content
}

style

case single
case split2Columns(Set<PlatformOption>)
case split3Columns(Set<PlatformOption>)
  • .single

>Always uses a single stack view regardless of screen resolution

  • .split2columns

``mermaid flowchart TD existsOptions{{"if let option = options.filter{$0 == Platform.current}"}} checkWidth{{"option.minWidth*2 >= currentWidth"}} if_iOS{{"Platform.current == .iOS"}} widthIsCompact{{"UserInterfaceSizeClass == .compact"}} two["2 column SplitView"] one["fullSize StackView"] existsOptions --false--> one widthIsCompact --true--> one checkWidth --false--> one existsOptions --true--> if_iOS if_iOS --true--> widthIsCompact if_iOS --false--> checkWidth widthIsCompact --false--> checkWidth checkWidth --true--> two ``

  • .split3columns

``mermaid flowchart TD existsOptions{{"if let option = options.filter{$0 == Platform.current}"}} checkWidth{{"option.minWidth3 >= currentWidth"}} checkWidthNext{{"option.minWidth2 >= currentWidth"}} if_iOS{{"Platform.current == .iOS"}} widthIsCompact{{"UserInterfaceSizeClass == .compact"}} three["3 column SplitView"] two["2 column SplitView"] one["fullSize StackView"] existsOptions --false--> one widthIsCompact --true--> one checkWidth --false--> checkWidthNext existsOptions --true--> if_iOS if_iOS --true--> widthIsCompact if_iOS --false--> checkWidth widthIsCompact --false--> checkWidth checkWidth --true----> three checkWidthNext --true--> two checkWidthNext --false--> one ``

PlatformOption
case mac(minWidth: Double)
case iOS(minWidth: Double)

Package Metadata

Repository: southkin/hiernav

Default branch: main

README: README.md