• Stars
    star
    1,312
  • Rank 35,858 (Top 0.8 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Powerful, Easy to use alert view or popup view on controller and window, support blur effects,custom view and animation,for objective-c,support iphone, ipad

TYAlertController

Powerful, Easy to use alertView or popupView on controller and window, support blur effect, custom view and custom animation, use aotolayout.support iphone, ipad .

CocoaPods

pod 'TYAlertController'

ScreenShot

image

Requirements

  • Xcode 5 or higher
  • iOS 7.0 or higher
  • ARC

Usage

1.copy TYAlertController Folder to your project, if you want to have blur effect ,you need copy Blur Effects Folder to your project.
2. #import "UIView+TYAlertView.h", when you use it, if you want use blur effect, #import "TYAlertController+BlurEffects.h".
3. you can use TYAlertController show in controller, or use TYShowAlertView show in window, or use Category UIView+TYAlertView convenient show alertview.
4. check Demo,it have more usefull usage and example.

usege demo

  • alertView lifecycle block
// alertView lifecycle block
@property (copy, nonatomic) void (^viewWillShowHandler)(UIView *alertView);
@property (copy, nonatomic) void (^viewDidShowHandler)(UIView *alertView);
@property (copy, nonatomic) void (^viewWillHideHandler)(UIView *alertView);
@property (copy, nonatomic) void (^viewDidHideHandler)(UIView *alertView);

// dismiss controller completed block
@property (nonatomic, copy) void (^dismissComplete)(void);
  • show in controller (tow way)(recommend)
TYAlertView *alertView = [TYAlertView alertViewWithTitle:@"TYAlertView" message:@"This is a message, the alert view containt text and textfiled. "];
    
    [alertView addAction:[TYAlertAction actionWithTitle:@"取消" style:TYAlertActionStyleCancle handler:^(TYAlertAction *action) {
        NSLog(@"%@",action.title);
    }]];

    [alertView addAction:[TYAlertAction actionWithTitle:@"确定" style:TYAlertActionStyleDestructive handler:^(TYAlertAction *action) {
        NSLog(@"%@",action.title);
    }]];
    
    [alertView addTextFieldWithConfigurationHandler:^(UITextField *textField) {
        textField.placeholder = @"请输入账号";
    }];
    [alertView addTextFieldWithConfigurationHandler:^(UITextField *textField) {
        textField.placeholder = @"请输入密码";
    }];
    
    // first way to show
    TYAlertController *alertController = [TYAlertController alertControllerWithAlertView:alertView preferredStyle:TYAlertControllerStyleAlert];
    //alertController.alertViewOriginY = 60;
    [self presentViewController:alertController animated:YES completion:nil];
    
    // second way to show,use UIView Category
    //[alertView showInController:self preferredStyle:TYAlertControllerStyleAlert];
  • show in window (tow way)
TYAlertView *alertView = [TYAlertView alertViewWithTitle:@"TYAlertView" message:@"A message should be a short, but it can support long message"];
    
    [alertView addAction:[TYAlertAction actionWithTitle:@"取消" style:TYAlertActionStyleCancle handler:^(TYAlertAction *action) {
        NSLog(@"%@",action.title);
    }]];
    
    [alertView addAction:[TYAlertAction actionWithTitle:@"确定" style:TYAlertActionStyleDestructive handler:^(TYAlertAction *action) {
        NSLog(@"%@",action.title);
    }]];
    
    // first way to show ,use UIView Category
    [alertView showInWindowWithOriginY:200 backgoundTapDismissEnable:YES];
    
    // second way to show
   // [TYShowAlertView showAlertViewWithView:alertView originY:200 backgoundTapDismissEnable:YES];

Contact

if you find bug,please pull reqeust me

More Repositories

1

TYAttributedLabel

TYAttributedLabel 简单,强大的属性文本控件(无需了解CoreText),支持图文混排显示,支持添加链接,image和UIView控件,支持自定义排版显示
Objective-C
2,890
star
2

TYCyclePagerView

a simple and usefull cycle pager view ,and auto scroll banner view(轮播图) ,include pageControl for iOS,support Objective-C and swift
Objective-C
1,755
star
3

DOPDropDownMenu-Enhanced

DOPDropDownMenu 添加双列表 优化版 新增图片支持(double tableView, The optimization version ,new add image,detailText)
Objective-C
1,748
star
4

TYPagerController

page scroll view and controller,simple,high custom,and have many tabBar styles,,support Objective-C and swift
Objective-C
1,375
star
5

LovePlayNews

LovePlayNews精仿爱玩iOS app,使用AsyncDisplayKit提高UI流畅性,项目结构及代码清晰明了
Objective-C
668
star
6

TYDownloadManager

Download file manager wrapped NSURLSessionDataTask and NSURLSessionDownloadTask,provide progress update and status change.
Objective-C
412
star
7

TYWaterWaveView

水波浪圆形进度控件,采用 CAShapeLayer,CADisplayLink 波浪动画,简单,流畅
Objective-C
398
star
8

TReaderBook

图文混排阅读器
Objective-C
276
star
9

TYLaunchAnimation

launching image or view Animation,UIView Category,easy to use.(启动图动画,带广告, 直接使用,支持自定义view,自定义动画)
Objective-C
271
star
10

KnowingLife

基于天气,查询,团购,新闻类查询应用,自己自学ios,写的第一个ios项目,也是面试作品,好久没用了,放着可惜,拿来给大家分享,希望给想写个项目,又无处着手的新人帮助,新手作品
Objective-C
140
star
11

TYText

text asynchronous rendering by TextKit for iOS
Objective-C
135
star
12

Prism

Application Performance Management & Monitoring for iOS (APM)
Objective-C
71
star
13

TYSwizzleDemo

method swizzling easy to use ,C Function and NSObject Categary
Objective-C
13
star
14

TYHttpManager

网络请求管理库,基于对AFNetwork的封装
Objective-C
13
star
15

TYDecorationSectionLayout

custom collectionView sections background view (decoration view)
Objective-C
11
star
16

WeiboDemo

Weibo demo using asynchronous rendering by TYText
Objective-C
10
star
17

TYJSONModel

A fast conversion between JSON and Model
Objective-C
7
star
18

BulletAnalyzer

斗鱼弹幕分析工具, 语义近似度合并, CG/CA图表数据绘制, Socket链接
Objective-C
5
star
19

TYPopupController

TYPopupController is presenting view controller or view as popups of other view controller
Objective-C
5
star
20

TYRefresh

a simple way to use pull-to-refresh (上下拉刷新),easy way to customize loading animation(自定义加载动画).
Objective-C
3
star
21

TYBarrageManager

barrage manager view (弹幕)
Objective-C
1
star
22

12207480.github.io

HTML
1
star
23

iOS-Txt-Core

A simple demo for UIPageViewController.
Objective-C
1
star
24

xinWeibo-demo

sina weibo demo 新浪微博 demo
Objective-C
1
star