A SwiftUI implementation of ramotion's Circle Menu.
It dynamically positions the buttons on screen based on the number of buttons that you pass to it.
- iOS 13.0 +
- Xcode 11.0 +
Add the SPM package to your Xcode project at main
https://github.com/andrewmarmion/AMCircleMenu.git
import AMCircleMenu
Create your the buttons the you want to display
let button = AMCircleMenu.CircleItem(image: Image(systemName: "0.circle.fill"),
color: .red,
action: { print("Hello from 0")})
let buttons: [AMCircleMenu.CircleItem] = [...]
let centerButton = AMCircleMenu.CenterButton(image: Image(systemName: "headphones"),
color: .yellow)
For the expanding circle menu use the following:
AMCircleMenu.CircleMenu(centerButton: centerButton,
circleItems: buttons)
For the vertical action menu use the following:
AMCircleMenu.VerticalMenu(centerButton: centerButton, circleItems: buttons)
- For the CircleMenu the maximum number of buttons that you can use is currently 10, the VerticalCircleMenu is limited by the height of the screen.
- You cannot currently set the size of the buttons or the how far away they move out from the center button.