# BAAlert
[![BAHome Team Name](https://img.shields.io/badge/Team-BAHome-brightgreen.svg?style=flat)](https://github.com/BAHome "BAHome Team")
![](https://img.shields.io/badge/platform-iOS-red.svg) ![](https://img.shields.io/badge/language-Objective--C-orange.svg)
![](https://img.shields.io/badge/license-MIT%20License-brightgreen.svg)
![](https://img.shields.io/cocoapods/v/BAAlert.svg?style=flat) ![](https://img.shields.io/cocoapods/dt/BAAlert.svg
) [![](https://img.shields.io/badge/微博-博爱1616-red.svg)](http://weibo.com/538298123)
## 1、功能及简介
* 1、手势触摸隐藏开关,可随时开关 <br>
* 2、可以自定义背景图片、背景颜色、按钮颜色
* 3、可以添加文字和图片,且可以滑动查看!
* 4、横竖屏适配完美
* 5、有各种炫酷动画展示你的 alert
* 6、可以自定义每个按钮颜色
## 2、图片示例
![BAAlert1.gif](https://github.com/BAHome/BAAlert/blob/master/Images/BAAlert1.gif)
![BAAlert2.gif](https://github.com/BAHome/BAAlert/blob/master/Images/BAAlert2.gif)
## 3、安装、导入示例和源码地址
* 1、pod 导入【最新版本:![](https://img.shields.io/cocoapods/v/BAAlert.svg?style=flat) ![](https://img.shields.io/cocoapods/dt/BAAlert.svg
)】: <br>
`pod 'BAAlert'` ` pod 'BAAlert-Swift'` <br>
如果发现 `pod search BAAlert` 搜索出来的不是最新版本,需要在终端执行 cd 转换文件路径命令退回到 desktop,然后执行 `pod setup` 命令更新本地spec缓存(可能需要几分钟),然后再搜索就可以了。<br>
具体步骤:
- pod setup : 初始化
- pod repo update : 更新仓库
- pod search BAAlert
* 2、文件夹拖入:下载demo,把 BAAlert 文件夹拖入项目即可,<br>
* 3、导入头文件:<br>
` #import "BAAlert_OC.h" `<br>
* 4、项目源码地址:<br>
OC 版 :[https://github.com/BAHome/BAAlert](https://github.com/BAHome/BAAlert)<br>
swift 版 :[https://github.com/BAHome/BAAlert-Swift](https://github.com/BAHome/BAAlert-Swift)<br>
## 4、BAAlert 的类结构及 demo 示例
![BAAlert.png](https://github.com/BAHome/BAAlert/blob/master/Images/BAAlert.png)
### BAAlert_OC.h
```
#ifndef BAAlert_OC_h
#define BAAlert_OC_h
#import "BAAlert.h"
#import "BAActionSheet.h"
#import "BAKit_ConfigurationDefine.h"
/*!
*********************************************************************************
************************************ 更新说明 ************************************
*********************************************************************************
欢迎使用 BAHome 系列开源代码 !
如有更多需求,请前往:https://github.com/BAHome
项目源码地址:
OC 版 :https://github.com/BAHome/BAAlert
最新更新时间:2017-08-21 【倒叙】 <br>
最新Version:【Version:1.2.4】 <br>
更新内容: <br>
1.2.4.1、修复 自定义背景图片不显示的问题(感谢群里 [@北京-邵峰] 同学提出的 bug!)<br>
最新更新时间:2017-08-18 【倒叙】 <br>
最新Version:【Version:1.2.3】 <br>
更新内容: <br>
1.2.3.1、优化自定义 alert 的布局,横竖屏可以适配了! <br>
最新更新时间:2017-06-23 【倒叙】
最新Version:【Version:1.2.2】
更新内容:
1.2.2.1、优化部分宏定义
最新更新时间:2017-06-19 【倒叙】 <br>
最新Version:【Version:1.2.0】 <br>
更新内容: <br>
1.2.0.1、统一全局宏定义文件,优化代码规范 <br>
最新更新时间:2017-05-20 【倒叙】 <br>
最新Version:【Version:1.1.9】 <br>
更新内容: <br>
1.1.9.1、修复动画过度白屏问题 <br>
最新更新时间:2017-05-15 【倒叙】 <br>
最新Version:【Version:1.1.8】 <br>
更新内容: <br>
1.1.8.1、精简代码结构,删除多余或者重复代码 <br>
1.1.8.2、规范代码属性和方法命名,原有方法名和属性名有较大改动,忘见谅 <br>
1.1.8.3、重构 actionSheet,新增多种样式 <br>
最新更新时间:2017-05-13 【倒叙】 <br>
最新Version:【Version:1.1.7】 <br>
更新内容: <br>
1.1.7.1、精简代码结构,删除多余或者重复代码 <br>
1.1.7.2、规范代码属性和方法命名,原有方法名和属性名有较大改动,忘见谅 <br>
1.1.7.3、优化部分动画 <br>
1.1.7.4、subView 布局优化 <br>
1.1.7.5、actionSheet 新增自定义文字颜色、title 字体颜色 <br>
最新更新时间:2017-05-10 【倒叙】 <br>
最新Version:【Version:1.1.5】 <br>
更新内容: <br>
1.1.5.1、删除原有封装内部按钮点击事件中 ba_dismissAlertView 方法,此方法可在外部自由调用 <br>
最新更新时间:2017-05-09 【倒叙】 <br>
最新Version:【Version:1.1.4】 <br>
更新内容: <br>
1.1.4.1、pod 更新xib 文件 <br>
最新更新时间:2017-05-08 【倒叙】
最新Version:【Version:1.1.0】
更新内容:
1.1.0.1、优化方法名命名规范
1.1.0.2、新增键盘内部处理
1.1.0.3、用原生 autoLayout 重构,自定义 alert 的布局再也不是问题了
1.1.0.4、优化代码结构,修复内在隐藏内存泄漏
1.1.0.5、新增 BAAlert_OC.h 文件,只需导入 BAAlert_OC.h 一个文件就可以使用 alert 和 actionSheet 了
1.1.0.6、删除了部分代码和属性,具体见源码 和 demo
*/
#endif /* BAAlert_OC_h */
```
### BAAlert.h
```
#import <UIKit/UIKit.h>
#import "BAAlert_Config.h"
@class BAAlert;
typedef void(^BAAlert_ConfigBlock)(BAAlert *tempView);
@interface BAAlert : UIView
/*! 背景颜色 默认:半透明*/
@property (nonatomic, strong) UIColor *bgColor;
/*! 是否开启边缘触摸隐藏 alert 默认:NO */
@property (nonatomic, assign) BOOL isTouchEdgeHide;
/*! 背景图片名字 默认:没有图片*/
@property (nonatomic, strong) NSString *bgImageName;
/*! 是否开启进出场动画 默认:NO,如果 YES ,并且同步设置进出场动画枚举为默认值:1 */
@property (nonatomic, assign, getter=isShowAnimate) BOOL showAnimate;
/*! 进出场动画枚举 默认:1 ,并且默认开启动画开关 */
@property (nonatomic, assign) BAAlertAnimatingStyle animatingStyle;
/*! 背景高斯模糊枚举 默认:没有模糊效果 */
@property (nonatomic, assign) BAAlertBlurEffectStyle blurEffectStyle;
/*!
* 创建一个完全自定义的 alertView
*
* @param customView 自定义 View
* @param configuration 属性配置:如 bgColor、buttonTitleColor、isTouchEdgeHide...
*/
+ (void)ba_alertShowCustomView:(UIView *)customView
configuration:(BAAlert_ConfigBlock) configuration;
/*!
* 创建一个类似于系统的alert
*
* @param title 标题:可空
* @param message 消息内容:可空
* @param image 图片:可空
* @param buttonTitleArray 按钮标题:不可空
* @param buttonTitleColorArray 按钮标题颜色:可空,默认蓝色
* @param configuration 属性配置:如 bgColor、buttonTitleColor、isTouchEdgeHide...
* @param actionBlock 按钮的点击事件处理
*/
+ (void)ba_alertShowWithTitle:(NSString *)title
message:(NSString *)message
image:(UIImage *)image
buttonTitleArray:(NSArray <NSString *>*)buttonTitleArray
buttonTitleColorArray:(NSArray <UIColor *>*)buttonTitleColorArray
configuration:(BAAlert_ConfigBlock)configuration
actionBlock:(BAAlert_ButtonActionBlock)actionBlock;
/*!
* 视图消失
*/
- (void)ba_alertHidden;
@end
```
### BAActionSheet.h
```
#import <UIKit/UIKit.h>
#import "BAAlert_Config.h"
@class BAActionSheet, BAActionSheetModel;
typedef void(^BAActionSheet_ConfigBlock)(BAActionSheet *tempView);
typedef void (^BAActionSheet_ActionBlock)(NSIndexPath *indexPath, BAActionSheetModel *model);
@interface BAActionSheet : UIView
/*! 是否开启边缘触摸隐藏 alert 默认:YES */
@property (nonatomic
没有合适的资源?快使用搜索试试~ 我知道了~
目标为停止,为最精简的警报封装!_Objective-C_Rub.zip
共48个文件
h:12个
m:9个
png:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 28 浏览量
2023-04-05
13:07:18
上传
评论
收藏 3.85MB ZIP 举报
温馨提示
目标为停止,为最精简的警报封装!_Objective-C_Rub.zip
资源推荐
资源详情
资源评论
收起资源包目录
目标为停止,为最精简的警报封装!_Objective-C_Rub.zip (48个子文件)
BACustomAlertView-master
BAAlert
ViewController.h 210B
BAAlert
BAActionSheet.m 17KB
UIView+BAAnimation.m 18KB
BAAlert.bundle
Images
arow_down@2x.png 1KB
arow_right@3x.png 2KB
arow_down@3x.png 1KB
arow_right@2x.png 1KB
UIView+BAAnimation.h 10KB
BAActionSheetCell.m 2KB
BAAlert.m 38KB
BAActionSheetCell.h 2KB
BAActionSheet.h 4KB
BAAlert_OC.h 5KB
BAAlert_Config.h 3KB
BAKit_ConfigurationDefine.h 13KB
BAAlert.h 4KB
CustomView.h 305B
Base.lproj
Main.storyboard 3KB
LaunchScreen.storyboard 2KB
AppDelegate.h 268B
AppDelegate.m 2KB
main.m 325B
背景.jpg 20KB
123.png 662KB
ViewController2.m 928B
ViewController2.h 212B
美女.jpg 338KB
CustomView.m 6KB
SSPopupView
BAPopupView.h 6KB
ViewController.m 19KB
Info.plist 1KB
Assets.xcassets
AppIcon.appiconset
Contents.json 585B
LICENSE 1KB
BAAlert.podspec 597B
BAAlert.xcodeproj
project.pbxproj 18KB
xcuserdata
boai.xcuserdatad
xcdebugger
Breakpoints_v2.xcbkptlist 473B
xcschemes
BAAlert.xcscheme 3KB
xcschememanagement.plist 479B
apple.xcuserdatad
xcdebugger
Breakpoints_v2.xcbkptlist 2KB
xcschemes
BAAlert.xcscheme 3KB
xcschememanagement.plist 479B
project.xcworkspace
contents.xcworkspacedata 152B
xcuserdata
boai.xcuserdatad
UserInterfaceState.xcuserstate 59KB
apple.xcuserdatad
UserInterfaceState.xcuserstate 21KB
Images
BAAlert2.gif 1.61MB
BAAlert1.gif 1.15MB
BAAlert.png 26KB
README.md 24KB
共 48 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功