Animated Play & Pause Button, subclass of UIButton written in Swift
How to use
// Initial the button with a particular frame
self.button = PlayPauseButton(frame: CGRectMake(0, 0, 50, 50))
// Add actions
self.button.addTarget(self, action: "toggle:", forControlEvents:.TouchUpInside)
// In the toggle function:
func toggle(sender: AnyObject!) {
self.button.showsMenu = !self.button.showsMenu
}
Customize
// Set the stroke color
self.button.strokeColor = UIColor.blue.CGColor
// Set the duration time
self.button.duration = 0.5
// Set the fill color
self.button.fillColor = UIColor.red.CGColor
// Set the line width
self.button.lineWidth = 2.5
This project is highly inspired by Robert Böhnke And CreativeDash team