Latest 0.1.0
Homepage https://github.com/VAndrJ/DownloadingProgressButton
License MIT
Platforms ios 8.0
Frameworks Foundation
Authors

Version
License
Platform

demo

Installation

DownloadingProgressButton is available through CocoaPods. To install
it, add the following line to your Podfile:

pod "DownloadingProgressButton"

Usage

You can use a DownloadingProgressButton on Storyboards

When the button is clicked, it will animate to pending rotation circle, inform you to start downloading and wait for downloading progress. You must implement delegate method:

func stateWasChanged(to newState: DownloadStates, sender: DownloadingProgressButton) {
    if newState == .pending {
        // MARK: perform some actions and inform button
        sender.downloadingStarted()
    }
}
// MARK: change downloading progress
button.downloadingProgressChanged(to: 0.2)

When this value reaches >= 1.0, then button is automatically animates to the end and takes done state.

To set or reset downloaded state:

button.downloadingSet()
button.downloadingReset()

To start animations programmatically:

button.startProgrammatically()

You can customize properties from Interface Builder:

properties

Example

To run the example project, clone the repo, choose Xcode 8 or Xcode 9 project and run pod install from the directory first.

Requirements

Swift 3+

Xcode 8+

Author

VAndrJ

License

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

Latest podspec

{
    "name": "DownloadingProgressButton",
    "version": "0.1.0",
    "summary": "Button with progress indicator.",
    "description": "Button with progress indicator. Use as downloading indicator or whatever you want.",
    "homepage": "https://github.com/VAndrJ/DownloadingProgressButton",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "VAndrJ": "[email protected]"
    },
    "source": {
        "git": "https://github.com/VAndrJ/DownloadingProgressButton.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "DownloadingProgressButton/Classes/**/*",
    "frameworks": "Foundation",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This