Skip to content

Kaww/MenuPicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

MenuPicker

Description: An animated menu picker in SwiftUI, using MatchedGeometryEffects.

Menu Picker

Usage

Define a liste of MenuPicker.Choice

private let choices = [
  MenuPicker.Choice(id: UUID().uuidString, title: "Home"),
  MenuPicker.Choice(id: UUID().uuidString, title: "Pictures"),
  MenuPicker.Choice(id: UUID().uuidString, title: "Videos"),
  MenuPicker.Choice(id: UUID().uuidString, title: "Documentation")
]

Define a state variable for the selected value

@State private var selectedChoice: MenuPicker.Choice?

Call the MenuPicker View with these properties

MenuPicker(
  choices: choices,
  selected: $selectedChoice
)

About

Matched Geometry Effect

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages