Latest 1.0.6
Homepage https://github.com/AndreasVerhoeven/AvePurchaseButton
License MIT
Platforms ios 7.0, requires ARC

Drop In App Store Styled Purchase Button, with proper animations. Title configurable in Interface Builder.

Animations

A gif-movie showing how the button animates from normal to confirmation to in-progress state:
Movie

Screenshot

A screenshot showing the different states of the button:
Screenshot

How to use

Create an instance of AvePurchaseButton. Set the normalTitle, confirmationTitle and handle UIControlEventTouchUpInside. To change states, use -[AvePurchaseButton setButtonState:animated:].

Example usage:

- (void)addPurchaseButton {
  AvePurchaseButton* button = [[AvePurchaseButton alloc] initWithFrame:CGRectZero];
    ;
    button.buttonState = AvePurchaseButtonStateNormal;
    button.normalTitle = @"$ 2.99";
    button.confirmationTitle = @"BUY";
    ;
    [self.view addSubview:button];
}

- (void)purchaseButtonTapped:(AvePurchaseButton*)button {
    switch(button.buttonState) {
        case AvePurchaseButtonStateNormal:
            ;
            break;

        case AvePurchaseButtonStateConfirmation:
            // start the purchasing progress here, when done, go back to 
            // AvePurchaseButtonStateProgress
            ;

            [self startPurchaseWithCompletionHandler:^{
               ;
            }];
            break;

        case AvePurchaseButtonStateProgress:
            break;
    }
}

Latest podspec

{
    "name": "AvePurchaseButton",
    "version": "1.0.6",
    "summary": "iOS App Store Styled Purchase Button",
    "description": "Drop In App Store Styled Purchase Button, with proper animations. Title configurable in Interface Builder.",
    "homepage": "https://github.com/AndreasVerhoeven/AvePurchaseButton",
    "screenshots": [
        "https://cloud.githubusercontent.com/assets/168214/11920880/852741d6-a77a-11e5-839d-e2f572e49475.gif",
        "https://cloud.githubusercontent.com/assets/168214/11920878/7c5d708e-a77a-11e5-8553-3806e89ba434.png"
    ],
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "Andreas Verhoeven",
    "social_media_url": "http://twitter.com/aveapps",
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/AndreasVerhoeven/AvePurchaseButton.git",
        "tag": "1.0.6"
    },
    "source_files": [
        "Source",
        "Source/**/*.{h,m}"
    ],
    "exclude_files": "Example",
    "public_header_files": [
        "Source/**/AvePurchaseButton.h",
        "Source/**/AveBorderedButton.h",
        "Source/**/AveBorderedView.h"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This