Latest 0.2.0
Homepage https://github.com/Viddi/ios-process-button
License MIT
Platforms ios 8.0, requires ARC
Authors

iOS Buttons that animate while an action is being processed. Written in Swift.

ProcessButton

This library was extracted from an iOS application that I was working on at the time. It’s used for any sort of action that is processed asynchronously, and shows a loading-like animation until the action is done.

Usage

Basic asynchronous task animation

@IBOutlet weak var btnSignIn: ProcessButton!

btnSignIn.animate(true)

// Do some some asynchronous stuff here
// and display result from callback

if callbackSuccess {
  self.btnSignIn.showSuccessText("Success", seconds: ProcessButtonUtil.Length.Short)
} else {
  self.btnSignIn.showErrorText("Error", seconds: ProcessButtonUtil.Length.Long)
}

Optional To change the colors of the lines and the duration, put this in your AppDelegate didFinishLaunchingWithOptions

// App wide customization
let colors = [UIColor.blueColor(), UIColor.redColor(), UIColor.greenColor()]
let duration: NSTimeInterval = 0.3

ProcessButtonUtil.sharedInstance
  .setColors(colors) // The colors for the animating lines. Can be any number of colors
  .setDuration(duration) // The time for each line to animate. Default is 0.5

Take a look at the project to see a full example.

Requirements

  • iOS 8 or later
  • Xcode 6 or later

Author

Vidar Ottosson, [email protected]

License

ProcessButton is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ProcessButton",
    "version": "0.2.0",
    "license": "MIT",
    "homepage": "https://github.com/Viddi/ios-process-button",
    "authors": {
        "Vidar Ottosson": "[email protected]"
    },
    "summary": "Button that animates while an action is being processed",
    "source": {
        "git": "https://github.com/Viddi/ios-process-button.git",
        "tag": "v0.2.0"
    },
    "source_files": "ProcessButton/ProcessButton/*",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true
}

Pin It on Pinterest

Share This