Skip to content

Circular menu interactive, customizable in color, buttons, and actions delegate

License

Notifications You must be signed in to change notification settings

julipopo/JCircular-Menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JCircular Menu

Platform Swift Version

Circular menu interactive, customizable in color, buttons, and actions delegate!
Available from 3 to 8 buttons.

Installation

add the Pod JCircularMenu to your podfile

Creation

  • Step 1 : Initialize the menu in the ViewController class:
var circularMenu =  JCircularMenu()
  • Step 2 : In the viewDidLoad, set the menu in its view, its the Color and its delegate :
circularMenu = JCircularMenu(inView: view, withColor: UIColor.blue)
circularMenu.delegate = self
  • Step 3 : set the buttons with a title and your local icons (from 3 to 8) :
menu.addButton(title: "Heel", imageName: "icon_heel")
menu.addButton(title: "Truck", imageName: "icon_truck")
menu.addButton(title: "Spider", imageName: "icon_spider")
menu.addButton(title: "Brique", imageName: "icon_brique")
menu.addButton(title: "Cardio", imageName: "icon_cardio")
menu.addButton(title: "Path", imageName: "icon_path")
menu.addButton(title: "Medecin", imageName: "icon_medecin")
  • Step 4 : add it to the view :
view.addSubview(menu)

Delegate Event :

  • Create an extension of your ViewController who conform to CircularMenuDelegate protocol, with circularMenuDidSelect function :
extension ViewController: JCircularMenuDelegate {
  func jcircularMenuDidSelect(atIndex index: Int) {
      //Do stuff once a button has been tapped
  }
}
  • Optional : you can listen event from the menu as jcircularMenuDidOpen() and jcircularMenuDidClose()

About

Circular menu interactive, customizable in color, buttons, and actions delegate

Resources

License

Stars

Watchers

Forks

Packages

No packages published