AMSmoothAlert 1.1

AMSmoothAlert 1.1

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布上一个发布版本2014年12月

Antoine Marliac 维护。




• 现在包含您请求的多个按钮功能 :)

• 现已发布在 Cocoapods 上的 AMSmoothAlert

我在 Dribbble 上看到了这个非常酷的弹出视图构想,所以我决定重现它!

Screen1

(上面的 gif 比实际的速度动画慢)

易于使用!

AMSmoothAlertView *alert = [[AMSmoothAlertView alloc]initWithTitle:@"Congrats !" 
        andText:@"You've just displayed this awesome alert view !" 
        forAlertType:AlertSuccess];

主要方法

//initialisation with a Title and a Text message
//drop animation init
- (id) initDropAlertWithTitle:(NSString*) title andText:(NSString*) text andCancelButton: BOOL)hasCancelButton forAlertType:(AlertType) type;
- (id) initDropAlertWithTitle:(NSString*) title andText:(NSString*) text andCancelButton:(BOOL)hasCancelButton forAlertType:(AlertType) type andColor:(UIColor*) color;

//fade in animation init
- (id) initFadeAlertWithTitle:(NSString*) title andText:(NSString*) text andCancelButton:(BOOL)hasCancelButton forAlertType:(AlertType) type;
- (id) initFadeAlertWithTitle:(NSString*) title andText:(NSString*) text andCancelButton:(BOOL)hasCancelButton forAlertType:(AlertType) type andColor:(UIColor*) color;

//set corner radius or not on the alertView
- (void) setCornerRadius:(float)cornerRadius;
//show the alertview!
- (void) show;
//dismiss it !
- (void) dismissAlertView;

支持完成块

alert.completionBlock = ^void (AMSmoothAlertView *alertObj, UIButton *button) {
        if(button == alertObj.defaultButton) {
                NSLog(@"Default");
        } else {
                NSLog(@"Others");
        }
};

您可以编辑标题和文本字体、圆形图标、颜色和“确定”按钮(即将推出多按钮功能)。

//title font customization
[alert setTitleFont:[UIFont fontWithName:@"Verdana" size:25.0f]];
//text message font customization
[alert setTextFont:[UIFont fontWithName:@"Futura-Medium" size:13.0f]];
//icon customization
[alert.logoView setImage:[UIImage imageNamed:@"checkMark.png"]];

目前有三种类型的弹出视图

typedef enum AlertType : NSInteger AlertType;
enum AlertType : NSInteger {
    AlertSuccess,
    AlertFailure,
    AlertInfo
};

即将到来的改进

  • KVO 绑定(例如更改按钮标签)
  • 性能
  • 更多定制
  • 更多圆形 + 图标
  • 更多动画

也请查看我的其他控制器 AMLoginViewController

@Toinetoine75

Antoine