OnOffButton alternatives and similar libraries
Based on the "Button" category.
Alternatively, view OnOffButton alternatives based on common mentions on social networks and blogs.
-
LGButton
A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code. -
PMSuperButton
🔥 PMSuperButton is a powerful UIButton coming from the countryside, but with super powers! 😎 -
ButtonProgressBar-iOS
A small and flexible (well documented) UIButton subclass with animated loading progress, and completion animation. -
NFDownloadButton
Revamped Download Button. It's kinda a reverse engineering of Netflix's app download button. -
JOEmojiableBtn
Since Facebook introduced reactions in 2016, it became a standard in several applications as a way for users to interact with content. ReactionButton is a control that allows developers to add this functionality to their apps in an easy way. -
FlowBarButtonItem
DISCONTINUED. Bar Button Item that can be moved anywhere in the screen, like Android's stickers button. -
DesignableButton
A Custom UIButton with Centralised Styling and common styles available in Interface Builder -
AnimatablePlayButton
Animated Play and Pause Button written in Swift, using CALayer, CAKeyframeAnimation. -
JSButton
A fully customisable swift subclass on UIButton which allows you to create beautiful buttons without writing any line of code.
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of OnOffButton or a related project?
README
Custom On/Off Animated UIButton, written in Swift. By Creativedash
About
This control is inspired on this Creative Dash dribbble:
Swift Upgrade
Use tags to fit your Swift version:
Swift 3 => 1.4
Swift 2.3 => 1.3
Installation
Carthage
Add the following to your Cartfile:
github "rakaramos/OnOffButton"
Then run carthage update
.
Follow the current instructions in Carthage's README for up to date installation instructions.
CocoaPods
Add the following to your Podfile:
pod 'OnOffButton'
You will also need to make sure you're opting into using frameworks:
use_frameworks!
Then run pod install
with CocoaPods 0.36 or newer.
Manually
Just copy the OnOffButton.swift
into your project.
Implementation
After the installation, you can use it straight in code or with xib/storyboard.
In code:
class ViewController: UIViewController {
let onOffButton = OnOffButton()
override func viewDidLoad() {
super.viewDidLoad()
onOffButton.frame = CGRect(origin: .zero, size:CGSize(width: 100,height: 100))
// Adjust properties
onOffButton.lineWidth = 5
onOffButton.strokeColor = .whiteColor()
onOffButton.ringAlpha = 0.3
onOffButton.addTarget(self, action: #selector(ViewController.didTapOnOffButton), forControlEvents: .TouchUpInside)
view.addSubview(onOffButton)
}
func didTapOnOffButton() {
onOffButton.checked = !onOffButton.checked
}
}
Using @IBDesignables
Set the UIButton
class to use OnOffButton
:
Configure the properties as you want:
Create an IBAction
:
@IBAction func changeButtonState(sender: OnOffButton) {
sender.checked = !sender.checked
}
Profit ;)
License
Released under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the OnOffButton README section above
are relevant to that project's source code only.