Skip to content

a good and customizable substitute like UIAlertController 一个多版本兼容的 类似于UIAlertViewController的控件...

License

Notifications You must be signed in to change notification settings

summerxx27/XTAlertViewController

Repository files navigation

preface: Meaning is to create a more versions compatible with similar to UIAlertView controls pic example:

Gif example:

Advantages

  • iOS 7.0 available after
  • Header Image (optional)
  • Title, des (optional)
  • Low coupling (present new controller)
  • Animation with UIKit Dynamics

Features

  • Provide the expansion of the more interesting and powerful features

Cocoapods

  • Add pod 'XTAlertViewController', '~> 1.0.1' to your Podfile
  • Run pod install or pod update --no-repo-update
  • import <XTAlertView.h>

Usage

    // init obj
    // Give a picture name
    // Give a picture's height
    // Give a btn's title array
    // Give a title
    // Give a describtion
    // Give a style  two btn | double btn
    // example 1
    [[XTAlertViewController new] showViewWithImage:@"summerxx" imageHeight:188 title:@"This is an introduction" btnTitles:@[@"Cancel", @"Determine"] des:@"A simple and easy to use more version using the controls Copyright © 2016年 夏天然后. All rights reserved." style:AlertDefault fromVC:self];
    // example 2
    XTAlertViewController *xtAlert = [[XTAlertViewController alloc] init];
    [xtAlert showViewWithImage:@"summerxx" imageHeight:188 title:@"This is an introduction" btnTitles:@[@"Cancel", @"Determine", @"Okey"] des:@"A simple and easy to use more version using the controls Copyright © 2016年 夏天然后. All rights reserved." style:AlertDouble fromVC:self];
    xtAlert.delegate = self;

If you use a proxy method

    // Signed an delegate
    @interface ViewController ()<XTAlertControllerDelegate>
    // 
    xt.delegate = self;

Implement delegate method like this

- (void)xt_alertViewControllerClickIndex:(NSInteger)buttonIndex
{

    switch (buttonIndex) {
        case 0:
            NSLog(@"0");
            NSLog(@"Cancel");
        break;
        case 1:
            NSLog(@"1");
            NSLog(@"Determine");
        break;
        case 2:
            NSLog(@"2");
            NSLog(@"summerxx");
        break;
        default:
        break;
    }
}

Contributing

  • If you need help, open an issue.
  • If you found a bug, open an issue.
  • If you have a new demand, also open an issue.

Acknowledgements

Made with by summerxx27 , Thank you for your use

MIT License

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

About

a good and customizable substitute like UIAlertController 一个多版本兼容的 类似于UIAlertViewController的控件...

Resources

License

Stars

Watchers

Forks

Packages

No packages published