Inspired by Apple’s download progress buttons in the app store

Overview

GBKUIButtonProgressView

Inspired by Apple’s download progress buttons in the app store

Created by @pklada and @miketsprague

Checkout the blog post.

gif

Installation

Cocoapods

pod 'GBKUIButtonProgressView', git: 'https://github.com/Guidebook/gbkui-button-progress-view'

Manually add to your project

Just add the files in GBKUIButtonProgressView/ to your project

Usage

  • Create the button as a custom view in your xib, or create it programatically
  • Make sure that you don't have a constraint for its width (it shrinks)--you might need to set the Intrinsic Content Size to "Placeholder" in your xib to avoid errors

intrinsic content size

self.downloadButton.initialTitle = @"Download";
self.downloadButton.completeTitle = @"Open";

// Add a target (like a regular button)
[self.downloadButton addTarget:self action:@selector(downloadButtonPressed:) forControlEvents:UIControlEventTouchUpInside];

-(void)downloadButtonPressed:(id)sender {
    // Update the button's state based on your downloading item's state
    if(!self.isDownloading && !self.isDownloaded) {
        [self.downloadButton startProgressing];
        [self downloadItem];
    } else if(self.isDownloaded) {
        [self openItem];
    } else {
        [self cancelDownloadingItem];
        [self.downloadButton setProgress:0 animated:YES withCompletion:^{
            [self.downloadButton reset];
        }];
    }
}

-(void)downloadProgressed:(CGFloat)progress {
  // Update the download button's progress when you get a progress update from your item
  [self.downloadButton setProgress:progress animated:YES];
}

To change the tint color, simply:

self.downloadButton.tintColor = [UIColor redColor];

See the example for more info.

Todos

  • Polish the API a bit
  • Allow it to be IBDesignable
  • Inherit from UIControl instead of UIView
You might also like...
LabelButtonKit is a mini library for labeled buttons (of SF Symbols), written entirely in SwiftUI
LabelButtonKit is a mini library for labeled buttons (of SF Symbols), written entirely in SwiftUI

A simple Button with an SFSymbol (icon) as a label, vertically. As well as a Dynamic Type variant using it horizontally. Using SwiftUI. A List View of buttons is also available here. Have fun! 🥳

Custom loading button with progress swiftui

CustomLoadingButton Simple Custom Loading Progress Button for SwiftUI Version 1.0.0 This version requires Xcode 11+ SwiftUI iOS 13+ macOS 10.15+ Insta

A small and flexible (well documented)  UIButton subclass with animated loading progress, and completion animation.
A small and flexible (well documented) UIButton subclass with animated loading progress, and completion animation.

ButtonProgressBar-iOS Example For LIVE PREVIEW on Appetize in your browser itself, click here. To run the example project, clone the repo, and run pod

ProgressButton - Custom button class that displays a progress bar around it to gauge
ProgressButton - Custom button class that displays a progress bar around it to gauge

ProgressButton Check it out To run the example project, clone the repo, and open the 'Example/Example.xcodeproj' file. Requirements This component is

IGStoryButtonKit provides an easy-to-use button with rich animation and multiple way inspired by instagram story/stories.
IGStoryButtonKit provides an easy-to-use button with rich animation and multiple way inspired by instagram story/stories.

Introduction Have you ever seen UI like instagram story, haven't you? Actually, features like instagram story have been implemented in many applicatio

Custom UIButton effect inspired by Google Material Design
Custom UIButton effect inspired by Google Material Design

ZFRippleButton iOS Custom UIButton effect inspired by Google Material Design written in Swift Usage Set the UIButton class in Nib to ZFRippleButton or

Recreating the cool parallax icons from Apple TV as iOS UIButtons (in Swift).
Recreating the cool parallax icons from Apple TV as iOS UIButtons (in Swift).

TVButton Recreating the cool parallax icons from Apple TV as iOS UIButtons (in Swift). The effect is triggered by long pressing or dragging. Usage Imp

Customizable download button with progress and transition animations. It is based on Apple's App Store download button.
Customizable download button with progress and transition animations. It is based on Apple's App Store download button.

AHDownloadButton is a customizable download button similar to the download button in the latest version of Apple's App Store app (since iOS 11). It fe

PBCircularProgressView is a circular progress view for iOS similar to the app store download progress view.
PBCircularProgressView is a circular progress view for iOS similar to the app store download progress view.

Overview PBCircularProgressView is a circular progress view for iOS similar to the app store download progress view. It also ha

MUDownloadButton -  a Progressive Download button written in pure swift and inspired by AppStore download button
MUDownloadButton - a Progressive Download button written in pure swift and inspired by AppStore download button

MUDownloadButton is a Progressive Download button written in pure swift and inspired by AppStore download button . feel free to contribute and pull requests

Revamped Download Button. It's kinda a reverse engineering of Netflix's app download button.
Revamped Download Button. It's kinda a reverse engineering of Netflix's app download button.

NFDownloadButton Revamped Download Button Requirements Installation Usage License Requirements iOS 8.0+ Swift 4.2+ Xcode 10.0+ Installation CocoaPods

Digger is a lightweight download framework that requires only one line of code to complete the file download task
Digger is a lightweight download framework that requires only one line of code to complete the file download task

中文说明 Digger is a lightweight download framework that requires only one line of code to complete the file download task. Based on URLSession, pure Swif

ipatool is a command line tool that allows you to search for iOS apps on the App Store and download a copy of the app package, known as an ipa file.
ipatool is a command line tool that allows you to search for iOS apps on the App Store and download a copy of the app package, known as an ipa file.

ipatool is a command line tool that allows you to search for iOS apps on the App Store and download a copy of the app package, known as an ipa file.

SwiftUI Animation Library. Useful SwiftUI animations including Loading/progress, Looping, On-off, Enter, Exit, Fade, Spin and Background animations that you can directly implement in your next iOS application or project. The library also contains huge examples of spring animations such as Inertial Bounce, Shake, Twirl, Jelly, Jiggle, Rubber Band, Kitchen Sink and Wobble effects. Browse, find and download the animation that fits your needs. 🍎 An App to check whether a non-App Store app is in App Store.
🍎 An App to check whether a non-App Store app is in App Store.

AppStorify 🍎 An App to check whether a non-App Store app is in App Store. Benfits Use App Store's upgrade mechanism instead of app's. App Store apps

Store-App - Store app made for IOS using Swift programming language
Store-App - Store app made for IOS using Swift programming language

Store-App Store app views products, cart, and using login from https://fakestore

A calculator for your Apple Watch but only if you have fingers small enough to press the buttons.
A calculator for your Apple Watch but only if you have fingers small enough to press the buttons.

AppleWatchCalculator A calculator for your Apple Watch but only if you have fingers small enough to press the buttons. A very simple calculator on you

 Progress.swift ⌛ Add beautiful progress bars to your loops.
Progress.swift ⌛ Add beautiful progress bars to your loops.

Progress.swift ⌛ Just wrap the SequenceType in your loop with the Progress SequenceType and you'll automatically get beautiful progress bars. Updating

MultiPeer-Progress-iOS - Swift project to demo the use of the MultiPeer framework to send files between iOS devices and show the progress
Comments
  • Exception when loading as a pod

    Exception when loading as a pod

    *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/mark/Library/Developer/CoreSimulator/Devices/D4397173-D3ED-4134-BC62-0E241F060EB9/data/Containers/Bundle/Application/0DB3AA57-2BB1-4C36-870D-B2E7158BF456/SIA.app> (loaded)' with name 'GBKUIButtonProgressView''
    
    opened by markst 3
  • Allow Subclassing, Push to CocoaPods

    Allow Subclassing, Push to CocoaPods

    Hi,

    could you please declare the classes, especially GBKUIButtonProgressView public? I would like to override e.g. the borderView.cornerRadius by subclassing. Or make the property public?

    btw: You should really push this to CocoaPods itself, so it's findable - it is still a great and helpful component!

    -- Frederik

    opened by winkelsdorf 0
Owner
Guidebook
Guidebook
Revamped Download Button. It's kinda a reverse engineering of Netflix's app download button.

NFDownloadButton Revamped Download Button Requirements Installation Usage License Requirements iOS 8.0+ Swift 4.2+ Xcode 10.0+ Installation CocoaPods

Leonardo Cardoso 433 Nov 15, 2022
A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code.

A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code. Preview You'll be

Lorenzo Greco 2.3k Dec 31, 2022
RadioGroup - The missing iOS radio buttons group.

RadioGroup The missing iOS radio buttons group. Usage let radioGroup = RadioGroup(titles: ["First Option Title", "Another Option Title", "Last"]) radi

Yonat Sharon 188 Dec 20, 2022
Animated Social share buttons control for iOS written in Swift

SwiftShareBubbles Animated Social share buttons control for iOS written in Swift. This library is inspired AAShareBubbles. I tried AAShareBubbles with

Takeshi Fujiki 175 Jun 11, 2022
Lickable-Button We made the buttons on the screen look so good you'll want to lick them

Lickable-Button We made the buttons on the screen look so good you'll want to lick them. - Steve Jobs A little SwiftUI button project at WWDC 2021 Lic

Nate Thompson 14 Dec 29, 2021
Added functionality that system buttons are not easy to implement

LLCustomButton Added functionality that system buttons are not easy to implement What are the functions ? Sets the position and spacing of text and im

coder 18 Jul 28, 2022
Added functionality that system buttons are not easy to implement

LLCustomButton Added functionality that system buttons are not easy to implement What are the functions ? Sets the position and spacing of text and im

coder 18 Jul 28, 2022
Yet another animated flat buttons in Swift

DynamicButton is a powerful flat design button written in Swift to display hamburger button like with animated transitions between style updates. It a

Yannick Loriot 1.2k Jan 5, 2023
An easy way to create beautiful social authentication buttons

EasySocialButton An easy way to create beautiful social authentication buttons Screenshots Installation Cocoa Pods pod 'EasySocialButton' Manual Drag

Antonio Zaitoun 162 Dec 11, 2022
A fully customisable swift subclass on UIButton which allows you to create beautiful buttons without writing any line of code.

JSButton Demo $ pod try JSButton ...or clone this repo and build and run/test the JSButton project in Xcode to see JSButton in action. If you don't ha

Jogendra 12 May 9, 2022