Skip to content

Animated Play & Pause Button, subclass of UIButton written in Swift 3

License

Notifications You must be signed in to change notification settings

KelvinJin/PlayPauseButton

Repository files navigation

PlayPauseButton

Animated Play & Pause Button, subclass of UIButton written in Swift

PlayPauseButton

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

Credit

This project is highly inspired by Robert Böhnke And CreativeDash team

About

Animated Play & Pause Button, subclass of UIButton written in Swift 3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages