TYAlertView 0.1.1

TYAlertView 0.1.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Oct 2016

Maintained by luckytianyiyan.



Feature

  • UIAppearance Support
  • Block Syntax

Usage

Simply

TYAlertView *alertView = [[TYAlertView alloc] initWithTitle:@"title" message:@"message"];
[alertView addAction:[TYAlertAction actionWithTitle:@"Ok"
                                              style:TYAlertActionStyleDefault
                                            handler:^(TYAlertAction * _Nonnull action) {
    NSLog(@"Ok button clicked");
}]];
[alertView show];

Custom TYAlertView Theme

[TYAlertView appearance].titleColor = [UIColor redColor];
[TYAlertView appearance].messageColor = [UIColor redColor];
[TYAlertView appearance].separatorColor = [UIColor grayColor];
[TYAlertView appearance].shadowRadius = 4.0f;
[TYAlertView appearance].popupViewBackgroundColor = [UIColor blueColor];
// Button Title Color
[[TYAlertView appearance] setButtonTitleColor:[UIColor yellowColor]
                               forActionStyle:TYAlertActionStyleDefault
                                     forState:UIControlStateNormal];

Example

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

Installation

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

pod "TYAlertView"

License

TYAlertView is available under the MIT license. See the LICENSE file for more info.