Skip to content

Textcat/PopCircleMenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PopCircleMenu

Pinterest like pop circle Menu

##Features

  • Adaptive direction
  • You can add a text above buttons
  • Customize the appearance
  • Written in Swift

##Usage

###Setup

popMenuView.circleButton?.delegate = self
//Buttons count
popMenuView.circleButton?.buttonsCount = 4
        
//Distance between buttons and the red circle
popMenuView.circleButton?.distance = 105
        
//Delay between show buttons
popMenuView.circleButton?.showDelay = 0.03
        
//Animation Duration
popMenuView.circleButton?.duration = 0.8

###Delegate methods

     func circleMenu(circleMenu: CircleMenu, buttonWillSelected button: CircleMenuButton, atIndex: Int) {
        print("button!!!!! will selected: \(atIndex)")
    }
    
    func circleMenu(circleMenu: CircleMenu, buttonDidSelected button: CircleMenuButton, atIndex: Int) {
        print("button!!!!! did selected: \(atIndex)")
    }

###Customization

func circleMenu(circleMenu: CircleMenu, willDisplay button: CircleMenuButton, atIndex: Int) {
   //set text
   guard let textLabel = button.textLabel else {return}
   textLabel.text = items[atIndex].text
   
   //set color
   button.backgroundColor = UIColor.lightGrayColor()
   button.setImage(UIImage(imageLiteral: items[atIndex].icon), forState: .Normal)
   button.layer.borderWidth = 5.0
   button.layer.borderColor = UIColor.whiteColor().CGColor
        
   // set highlited image
   let highlightedImage  = UIImage(imageLiteral: items[atIndex].icon).imageWithRenderingMode(.AlwaysTemplate)
   button.setImage(highlightedImage, forState: .Highlighted)
   button.tintColor = UIColor.init(colorLiteralRed: 0, green: 0, blue: 0, alpha: 0.3)
        
}

Take a look at Example for more information.

##Install ###Cocoapods

use_frameworks!
pod ‘PopCircleMenu’, :git => 'https://github.com/luiyezheng/PopCircleMenu.git'

##Plan

##Acknowledgement Inspired by circle-menu and Pinterst

Based on circle-menu

##Author Luiyezheng ,luiyezheng@foxmail.com