All Projects → PavelKatunin → Downloadbutton

PavelKatunin / Downloadbutton

Licence: other
Customizable App Store style download button

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language
swift
15916 projects

Projects that are alternatives of or similar to Downloadbutton

pikko
Color picker for iOS made with ❤️
Stars: ✭ 34 (-97.78%)
Mutual labels:  cocoapod, uikit
Squishbutton
A button that squishes when pressed. As seen in the Clips app.
Stars: ✭ 401 (-73.83%)
Mutual labels:  uikit, button
liquid button
Liquify your buttons, web demo at website
Stars: ✭ 18 (-98.83%)
Mutual labels:  button, buttons
btns
A collection of buttons with cool hover effects
Stars: ✭ 78 (-94.91%)
Mutual labels:  button, buttons
Tkswitchercollection
An animation switch collection
Stars: ✭ 877 (-42.75%)
Mutual labels:  uikit, ios-animation
trace-cocoa-sdk
Catch bugs before they reach production — get detailed crash reports and monitor how your app is performing across the entire install base.
Stars: ✭ 15 (-99.02%)
Mutual labels:  cocoapod, uikit
IGStoryButtonKit
IGStoryButtonKit provides an easy-to-use button with rich animation and multiple way inspired by instagram story/stories.
Stars: ✭ 31 (-97.98%)
Mutual labels:  uikit, ios-animation
Tristatetogglebutton
Customizable tri-state toggle button (with three states, three state toggle) for Android
Stars: ✭ 198 (-87.08%)
Mutual labels:  button, buttons
Pmsuperbutton
🔥 PMSuperButton is a powerful UIButton coming from the countryside, but with super powers! 😎
Stars: ✭ 653 (-57.38%)
Mutual labels:  customizable, button
Ttsegmentedcontrol
An elegant, animated and customizable segmented control for iOS created by Tapptitude
Stars: ✭ 471 (-69.26%)
Mutual labels:  uikit, customizable
Chromacolorpicker
🎨 An intuitive iOS color picker built in Swift.
Stars: ✭ 434 (-71.67%)
Mutual labels:  customizable, ios-animation
Sizeslidebutton
A fun Swift UIControl for picking a size
Stars: ✭ 46 (-97%)
Mutual labels:  ios-animation, button
Hhcustomcorner
Awesome library to customize corners of UIView and UIButton. Now you can customize each corner differently
Stars: ✭ 36 (-97.65%)
Mutual labels:  customizable, button
Tkrubberindicator
A rubber animation pagecontrol
Stars: ✭ 1,337 (-12.73%)
Mutual labels:  uikit, ios-animation
Uikit React
UIkit components built with React
Stars: ✭ 111 (-92.75%)
Mutual labels:  uikit
Vue Notus
Vue Notus: Free Tailwind CSS UI Kit and Admin
Stars: ✭ 108 (-92.95%)
Mutual labels:  uikit
Flutter Reaction Button
Flutter reaction button plugin it is fully customizable widget such as Facebook reaction button
Stars: ✭ 111 (-92.75%)
Mutual labels:  button
Swiftyviper
Swift Interaction with VIPER Architecture
Stars: ✭ 110 (-92.82%)
Mutual labels:  cocoapod
Distancepicker
Custom UIKit control to select a distance with a pan gesture, written in Swift
Stars: ✭ 118 (-92.3%)
Mutual labels:  uikit
Skeletonview
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
Stars: ✭ 10,804 (+605.22%)
Mutual labels:  ios-animation

DownloadButton

[![CI Status](http://img.shields.io/travis/Pavel Katunin/DownloadButton.svg?style=flat)](https://travis-ci.org/Pavel Katunin/DownloadButton) Version License Platform

Customizable appstore style download button.

Default button animation

Default button

Customizable designable components. Editing with IB.

Custom button animation

Custom button

Designable button

Usage

To run the example project, clone the repo, and run pod install from the Example directory first. Check example project to see usage.

#import <DownloadButton/PKDownloadButton.h>

Usage for representing network operations:

#pragma mark - PKDownloadButtonDelegate

- (void)downloadButtonTapped:(PKDownloadButton *)downloadButton 
                currentState:(PKDownloadButtonState)state {
    switch (state) {
        case kPKDownloadButtonState_StartDownload:
            self.downloadButton.state = kPKDownloadButtonState_Pending;
            [self.pendingSimulator startDownload];
        break;
        case kPKDownloadButtonState_Pending:
            [self.pendingSimulator cancelDownload];
            self.downloadButton.state = kPKDownloadButtonState_StartDownload;
        break;
            case kPKDownloadButtonState_Downloading:
            [self.downloaderSimulator cancelDownload];
            self.downloadButton.state = kPKDownloadButtonState_StartDownload;
        break;
        case kPKDownloadButtonState_Downloaded:
            self.downloadButton.state = kPKDownloadButtonState_StartDownload;
            self.imageView.hidden = YES;
        break;
        default:
            NSAssert(NO, @"unsupported state");
        break;
    }
}

#pragma mark - DownloaderSimulatorDelegate

- (void)simulator:(PKDownloaderSimulator *)simulator didUpdateProgress:(double)progress {
    if (simulator == self.pendingSimulator) {
        if (progress == 1.) {
            self.downloadButton.state = kPKDownloadButtonState_Downloading;
            [self.downloaderSimulator startDownload];
        }
    }
    else if (simulator == self.downloaderSimulator) {
        self.downloadButton.stopDownloadButton.progress = progress;
        if (progress == 1) {
            self.downloadButton.state = kPKDownloadButtonState_Downloaded;
            self.imageView.hidden = NO;
        }
    }
}

Appearance customization:

#import "UIImage+PKDownloadButton.h"
#import "UIButton+PKDownloadButton.h"

[self.downloadButton.downloadedButton cleanDefaultAppearance];
[self.downloadButton.downloadedButton setBackgroundImage:[UIImage buttonBackgroundWithColor:[UIColor redColor]]
forState:UIControlStateNormal];
[self.downloadButton.downloadedButton setBackgroundImage:[UIImage highlitedButtonBackgroundWithColor:[UIColor redColor]]
forState:UIControlStateHighlighted];
[self.downloadButton.downloadedButton setTitle:@"delete" forState:UIControlStateNormal];
[self.downloadButton.downloadedButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
[self.downloadButton.downloadedButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];

self.downloadButton.stopDownloadButton.tintColor = [UIColor blackColor];
self.downloadButton.stopDownloadButton.filledLineStyleOuter = YES;

self.downloadButton.pendingView.tintColor = [UIColor orangeColor];
self.downloadButton.pendingView.radius = 24.f;
self.downloadButton.pendingView.emptyLineRadians = 2.f;
self.downloadButton.pendingView.spinTime = 3.f;

[self.downloadButton.startDownloadButton cleanDefaultAppearance];
[self.downloadButton.startDownloadButton setImage:[UIImage imageNamed:@"download_default"] forState:UIControlStateNormal];

Requirements

Requires iOS SDK version > 8.0

Installation

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

pod "DownloadButton"

Author

Pavel Katunin, [email protected]

License

DownloadButton is available under the Apache License, Version 2.0. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].