RAlertView 0.1.1

RAlertView 0.1.1

测试测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2016年11月

roycms维护。



 
依赖项
Masonry>= 0
RGB>= 0
 

  • roycms

AlertView 是一个弹出框架,可以简单方便地加入到你的项目中。

警告内容

Warning content

安装

  • 依赖于项目 MasonryHexColors。导入 #import "Masonry.h"#import "HexColors.h"
  • 导入主头文件:#import "RAlertView.h"

预览 AlertStyle

typedef NS_ENUM(NSInteger,AlertStyle) {
    SimpleAlert = 0,
    ConfirmAlert,
    CancelAndConfirmAlert,
};

RAlertView Preview

预览 AlertTheme

   RAlertView *alert = [[RAlertView alloc] initWithStyle:CancelAndConfirmAlert];
   alert.theme =[UIColor redColor];

RAlertView Preview

一些功能集

  • 点击背景和任何位置隐藏弹出窗口
alert.isClickBackgroundCloseWindow = YES;
  • 设置弹动内容文本居中
alert.contentTextLabel.text =@"SimpleAlert \nAlertView A pop-up framework, Can be simple and convenient to join your project";

alert.contentTextLabel.attributedText = [TextHelper attributedStringForString:@"AlertView A pop-up framework, Can be simple and convenient to join your project" lineSpacing:5];

初始化 RAlertView

  • initWithStyle AlertStyle
RAlertView *alert = [[RAlertView alloc] initWithStyle:SimpleAlert];
  • initWithStyle AlertStyle 和 width
RAlertView *alert = [[RAlertView alloc] initWithStyle:SimpleAlert width:0.8];

简单Alert

RAlertView *alert = [[RAlertView alloc] initWithStyle:SimpleAlert width:0.8];
alert.isClickBackgroundCloseWindow = YES;
alert.contentTextLabel.text =@"SimpleAlert \nAlertView A pop-up framework, Can be simple and convenient to join your project";

确认Alert

RAlertView *alert = [[RAlertView alloc] initWithStyle:ConfirmAlert];
alert.headerTitleLabel.text = @"ConfirmAlert";
alert.contentTextLabel.attributedText = [TextHelper attributedStringForString:@"AlertView A pop-up framework, Can be simple and convenient to join your project" lineSpacing:5];
[alert.confirmButton setTitle:@"Ok" forState:UIControlStateNormal];
alert.confirm = ^(){
        NSLog(@"Click on the Ok");
   };

取消 confirm Alert

RAlertView *alert = [[RAlertView alloc] initWithStyle:CancelAndConfirmAlert];
alert.headerTitleLabel.text = @"CancelAndConfirmAlert";
alert.contentTextLabel.attributedText = [TextHelper attributedStringForString:@"AlertView A pop-up framework, Can be simple and convenient to join your project" lineSpacing:5];;
[alert.confirmButton setTitle:@"Ok" forState:UIControlStateNormal];
[alert.cancelButton setTitle:@"Cancel" forState:UIControlStateNormal];
alert.confirm = ^(){
        NSLog(@"Click on the Ok");
   };
alert.cancel = ^(){
        NSLog(@"Click on the Cancel");
   };

待办事项

  • 增加不同状态图标效果
  • 增加弹出框内支持输入框,可输入内容
  • 增加微信名片

期待

  • 如果在使用过程中遇到错误,希望你能Issues我,谢谢(或者尝试下载最新的框架代码看看错误是否修复了)
  • 如果在使用过程中发现功能不够用,希望你能Issues我,我非常想为这个框架添加更多有用的功能,谢谢
  • 如果你想为RAlertView贡献代码,请拼命Pull Requests我

排版规范参考 https://github.com/sparanoid/chinese-copywriting-guidelines