Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

MAConfirmButton is an animated subclass of UIButton that replicates and improves upon the behavior of the AppStore “Buy Now” buttons. Built and animated with Core Animation layers, it is completely image free.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 MAConfirmButton
Octocat-spinner-32 Sample.xcodeproj
Octocat-spinner-32 Sample
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.textile
README.textile

MAConfirmButton

MAConfirmButton is an animated subclass of UIButton that replicates and improves upon the behavior of the AppStore “Buy Now” buttons.

Usage

I attempted to make this class as “drop-in” as possible since it is, after all, a subclass of UIButton. Your project must include the QuartzCore framework.

Example

MAConfirmButton *confirmButton = [MAConfirmButton buttonWithTitle:@"Button Title" confirm:@"Confirm Title"];
[confirmButton addTarget:self action:@selector(action:) forControlEvents:UIControlEventTouchUpInside];	
[confirmButton setTintColor:[UIColor blueColor]];
[confirmButton setAnchor:CGPointMake(270, 25)];	
[self.view addSubview:confirmButton];

Init

+ (MAConfirmButton *)buttonWithTitle:(NSString *)disabledString confirm:(NSString *)confirmString;
+ (MAConfirmButton *)buttonWithDisabledTitle:(NSString *)disabledString;

Anchor

It is important that the anchor be set in order to position this button in the view you are adding it to (height\width of the frame are calculated automatically). For now, the anchor point is the top right and the button is always aligned right, like the AppStore.

- (void)setAnchor:(CGPoint)anchor;

Change State

- (void)disableWithTitle:(NSString *)disabledString;
Something went wrong with that request. Please try again.