Simple circle menu animated :
To run the example project, clone the repo, and run pod install
from the Example directory first.
- Swift 3.0 & Xcode 8
- iOS 8 and later
Drag and drop folder CPMenuView
to your project.
CPMenuView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'CPMenuView', '~> 1.0'
You can create and custom home button
let menuButton = HomeMenuButton(image: UIImage(named:"menu")!, size: CGSize(width: 50, height: 50))
menuButton.pressedImage = UIImage(named: "close")
Set animation of menu
let animator = CPMenuAnimator(commonDuration: 0.5, commonSpringWithDamping: 0.5, commonSpringVelocity: 10)
Create menu view
menuView = CPMenuView(parentView: self.view, homeButton: menuButton, animator: animator,type: .all,radius: 130, isClockWise: true)
menuView.delegate = self
menuView.datasource = self
You need set position for home button
menuView.setHomeButtonPosition(position: CGPoint(x: view.center.x, y: view.center.y - 100))
Contributions for bug fixing or improvements are welcome. Feel free to submit a pull request.
Chi Phuong, vonguyenchiphuong@gmail.com
CPMenuView is available under the MIT license. See the LICENSE file for more info.