Forget about typical stereotypic loading, It's time to change. SSSpinnerButton is an elegant button with a different spinner animations.
SSSpinnerButton is a versatile library for iOS developers, written in Swift, that allows you to easily create and customize spinner buttons. With this library, you can add loading spinners to your buttons, providing visual feedback to your users while they wait for a process to complete. The library offers a wide range of customizable options, including spinner color, size as well as button text, font, and background color. SSSpinnerButton is simple to integrate into your existing projects and offers excellent performance, making it an essential tool for any iOS developer looking to enhance their user interface.
Are looking for swiftUI? Try SSSwiftUISpinnerButton for a more conventional set of APIs.
CocoaPods
You can use CocoaPods to install SSSpinnerButton by adding it to your Podfile:
use_frameworks!
pod 'SSSpinnerButton'
import UIKit
import SSSpinnerButton
Carthage
github simformsolutions/SSSpinnerButton
to your project’s CartfileSwift Package Manager
SSSpinnerButton
through Swift Package Manager by going to your Project settings > Swift Packages
and add the repository by providing the GitHub URL. Alternatively, you can go to File
> Swift Packages
> Add Package Dependencies...
Manually
In the storyboard add a UIButton and change its class to SSSpinnerButton
StartAnimation
button.startAnimate(spinnerType: SpinnerType.ballClipRotate, spinnercolor: UIColor.red, spinnerSize: 20, complete: {
// Your code here
})
StopAnimation
button.stopAnimate(complete: {
// Your code here
})
StopAnimation with completion types
button.stopAnimatingWithCompletionType(completionType: .success, complete: {
// Your code here
})
StopAnimation with completion types and back to defaults
button.stopAnimationWithCompletionTypeAndBackToDefaults(completionType: .fail, backToDefaults: true, complete: {
// Your code here
})
To give Default RippleEffect just set this “Set Ripple Effect” value to On
To Change the RippleEffect
button.setRippleEffect(rippleEffectAnimationDuration: Double, initialOpacity: Double, rippleEffectColor: UIColor, rippleEffectPercent: Double, initialRippleEffectPercent: Double)
Version 3.0.1
Version 2.0.1
Whether you’re helping us fix bugs, improve the docs, or a feature request, we’d love to have you! 💪
Check out our Contributing Guide for ideas on contributing.
Give a ⭐️ if this project helped you!
This project is licensed under the MIT License - see the LICENSE file for details