mps / MPSFollowButton

A UIButton subclass that mimics the Follow button found in Instagram for iOS 7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MPSFollowButton

A UIButton subclass that mimics the Follow button found in Instagram for iOS 7.

Installation

If you're using CocoaPods, simply add the following line to your Podfile:

pod 'MPSFollowButton'

Example

Screenshot

Usage

Using MPSFollowButton is quite simple. All you need to do is create one, add it to your view and then toggle the different states.

For more an example, check out the example project included in this repository and file an issue if you run into any problems.

To toggle one of the states use one of the following methods on an instance of a MPSFollowButton.

- (void)setFollow;

- (void)setFollowWithText:(NSString *)titleLabelText;

- (void)setFollowing;

- (void)setFollowingWithText:(NSString *)titleLabelText;

- (void)setLoading;

- (void)setLoadingWithText:(NSString *)titleLabelText;

Customization

MPSFollowButton can be customized in several ways. You can customize the Button's Foreground and Background colors for both Normal and Selected states:

@property (nonatomic, strong) UIColor *followBackgroundColor;

@property (nonatomic, strong) UIColor *followingBackgroundColor;

@property (nonatomic, strong) UIColor *loadingBackgroundColor;

@property (nonatomic, strong) UIColor *followForegroundColor;

@property (nonatomic, strong) UIColor *followingForegroundColor;

@property (nonatomic, strong) UIColor *loadingForegroundColor;

Credits

Thanks to Instagram for the inspiration :)

Contact

License

See LICENSE.

About

A UIButton subclass that mimics the Follow button found in Instagram for iOS 7

License:MIT License