├── .swift-version ├── BAAlert.podspec ├── BAAlert ├── Classes │ ├── .gitkeep │ └── BAAlert │ │ ├── BAActionSheet.h │ │ ├── BAActionSheet.m │ │ ├── BAActionSheetCell.h │ │ ├── BAActionSheetCell.m │ │ ├── BAAlert.h │ │ ├── BAAlert.m │ │ ├── BAAlert_Config.h │ │ ├── BAAlert_OC.h │ │ ├── BAAlert_Version.h │ │ ├── BAKit_ConfigurationDefine.h │ │ ├── CALayer+BAAnimation.h │ │ ├── CALayer+BAAnimation.m │ │ ├── NSBundle+BAPod.h │ │ ├── NSBundle+BAPod.m │ │ ├── UIView+BAAnimation.h │ │ └── UIView+BAAnimation.m └── Resources │ ├── BAAlert.bundle │ ├── arow_down.png │ └── arow_right.png │ └── BAAlert.xcassets │ ├── Contents.json │ ├── arow_down.imageset │ ├── Contents.json │ ├── arow_down@2x.png │ └── arow_down@3x.png │ └── arow_right.imageset │ ├── Contents.json │ ├── arow_right@2x.png │ └── arow_right@3x.png ├── Example ├── BAAlert.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── BAAlert-Example.xcscheme ├── BAAlert.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── sunboyan.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist ├── BAAlert │ ├── BAAlert-Info.plist │ ├── BAAlert-Prefix.pch │ ├── BAAppDelegate.h │ ├── BAAppDelegate.m │ ├── BAViewController.h │ ├── BAViewController.m │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── CustomView.h │ ├── CustomView.m │ ├── Images.xcassets │ │ ├── 123.imageset │ │ │ ├── 123.png │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── 美女.imageset │ │ │ ├── Contents.json │ │ │ └── 美女.jpg │ │ └── 背景.imageset │ │ │ ├── Contents.json │ │ │ └── 背景.jpg │ ├── Main.storyboard │ ├── ViewController2.h │ ├── ViewController2.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── Podfile ├── Podfile.lock └── Pods │ ├── Local Podspecs │ └── BAAlert.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── sunboyan.xcuserdatad │ │ └── xcschemes │ │ ├── BAAlert-BAAlert.xcscheme │ │ ├── BAAlert.xcscheme │ │ ├── Pods-BAAlert_Example.xcscheme │ │ └── xcschememanagement.plist │ └── Target Support Files │ ├── BAAlert │ ├── BAAlert-Info.plist │ ├── BAAlert-dummy.m │ ├── BAAlert-prefix.pch │ ├── BAAlert-umbrella.h │ ├── BAAlert.modulemap │ ├── BAAlert.xcconfig │ └── ResourceBundle-BAAlert-BAAlert-Info.plist │ └── Pods-BAAlert_Example │ ├── Pods-BAAlert_Example-Info.plist │ ├── Pods-BAAlert_Example-acknowledgements.markdown │ ├── Pods-BAAlert_Example-acknowledgements.plist │ ├── Pods-BAAlert_Example-dummy.m │ ├── Pods-BAAlert_Example-frameworks.sh │ ├── Pods-BAAlert_Example-resources.sh │ ├── Pods-BAAlert_Example-umbrella.h │ ├── Pods-BAAlert_Example.debug.xcconfig │ ├── Pods-BAAlert_Example.modulemap │ └── Pods-BAAlert_Example.release.xcconfig ├── Images ├── BAAlert.png ├── BAAlert1.gif └── BAAlert2.gif ├── LICENSE ├── README.md └── _Pods.xcodeproj /.swift-version: -------------------------------------------------------------------------------- 1 | 2.3 2 | -------------------------------------------------------------------------------- /BAAlert.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint BAAlert.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'BAAlert' 11 | s.version = "1.2.7" 12 | s.summary = '目前为止,最为精简的 alert 和 actionSheet 封装!BAAlert 让你的弹框不再孤单!' 13 | 14 | s.description = <<-DESC 15 | TODO: Add long description of the pod here. 16 | DESC 17 | 18 | s.homepage = 'https://github.com/BAHome/BAAlert' 19 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 20 | s.license = { :type => 'MIT', :file => 'LICENSE' } 21 | s.author = { 'boai' => 'sunboyan@outlook.com' } 22 | s.source = { :git => 'https://github.com/BAHome/BAAlert.git', :tag => s.version.to_s } 23 | 24 | s.resource_bundles = { 25 | 'BAAlert' => ['BAAlert/Resources/*.{xcassets,bundle}', 26 | 'BAAlert/**/*.{xib,nib,json,plist}'] 27 | } 28 | 29 | s.source_files = "BAAlert/**/*.{h,m}" 30 | s.public_header_files = 'BAAlert/Classes/**/*.h}' 31 | s.frameworks = 'UIKit', 'Foundation' 32 | 33 | s.ios.deployment_target = '8.0' 34 | s.requires_arc = true 35 | 36 | end 37 | -------------------------------------------------------------------------------- /BAAlert/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/BAAlert/Classes/.gitkeep -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/BAActionSheet.h: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * @header BAKit.h 4 | * 5 | * @brief BAKit 6 | * 7 | * @author 博爱 8 | * @copyright Copyright © 2016年 博爱. All rights reserved. 9 | * @version V1.0 10 | */ 11 | 12 | // _ooOoo_ 13 | // o8888888o 14 | // 88" . "88 15 | // (| -_- |) 16 | // O\ = /O 17 | // ____/`---'\____ 18 | // . ' \\| |// `. 19 | // / \\||| : |||// \ 20 | // / _||||| -:- |||||- \ 21 | // | | \\\ - /// | | 22 | // | \_| ''\---/'' | | 23 | // \ .-\__ `-` ___/-. / 24 | // ___`. .' /--.--\ `. . __ 25 | // ."" '< `.___\_<|>_/___.' >'"". 26 | // | | : `- \`.;`\ _ /`;.`/ - ` : | | 27 | // \ \ `-. \_ __\ /__ _/ .-` / / 28 | // ======`-.____`-.___\_____/___.-`____.-'====== 29 | // `=---=' 30 | // 31 | // ............................................. 32 | // 佛祖镇楼 BUG辟易 33 | // 佛曰: 34 | // 写字楼里写字间,写字间里程序员; 35 | // 程序人员写程序,又拿程序换酒钱。 36 | // 酒醒只在网上坐,酒醉还来网下眠; 37 | // 酒醉酒醒日复日,网上网下年复年。 38 | // 但愿老死电脑间,不愿鞠躬老板前; 39 | // 奔驰宝马贵者趣,公交自行程序员。 40 | // 别人笑我忒疯癫,我笑自己命太贱; 41 | // 不见满街漂亮妹,哪个归得程序员? 42 | 43 | /* 44 | 45 | ********************************************************************************* 46 | * 47 | * 在使用 BAKit 的过程中如果出现 bug 请及时以以下任意一种方式联系我,我会及时修复 bug 48 | * 49 | * QQ : 可以添加ios开发技术群 479663605 在这里找到我(博爱1616【137361770】) 50 | * 微博 : 博爱1616 51 | * Email : 137361770@qq.com 52 | * GitHub : https://github.com/boai 53 | * BAHome : https://github.com/BAHome 54 | * 博客 : http://boaihome.com 55 | 56 | ********************************************************************************* 57 | 58 | */ 59 | 60 | 61 | #import 62 | #import "BAAlert_Config.h" 63 | 64 | @class BAActionSheet, BAActionSheetModel; 65 | 66 | typedef void(^BAActionSheet_ConfigBlock)(BAActionSheet *tempView); 67 | typedef void (^BAActionSheet_ActionBlock)(NSIndexPath *indexPath, BAActionSheetModel *model); 68 | 69 | 70 | @interface BAActionSheet : UIView 71 | 72 | /*! 是否开启边缘触摸隐藏 alert 默认:YES */ 73 | @property (nonatomic, assign) BOOL isTouchEdgeHide; 74 | 75 | /*! 是否开启进出场动画 默认:NO,如果 YES ,并且同步设置进出场动画枚举为默认值:1 */ 76 | @property (nonatomic, assign, getter=isShowAnimate) BOOL showAnimate; 77 | 78 | /*! 进出场动画枚举 默认:1 ,并且默认开启动画开关 */ 79 | @property (nonatomic, assign) BAAlertAnimatingStyle animatingStyle; 80 | 81 | /*! BAActionSheet 类型,默认:1 */ 82 | @property (nonatomic, assign) BAActionSheetType actionSheetType; 83 | 84 | @property (nonatomic, strong) NSArray *dataArray; 85 | @property (nonatomic, strong) NSString *title; 86 | 87 | /*! 88 | * 89 | * @param configuration 属性配置:如 bgColor、buttonTitleColor、isTouchEdgeHide... 90 | * @param actionBlock block回调点击的选项 91 | */ 92 | + (void)ba_actionSheetShowWithConfiguration:(BAActionSheet_ConfigBlock)configuration 93 | actionBlock:(BAActionSheet_ActionBlock)actionBlock; 94 | 95 | /*! 96 | * 隐藏 BAActionSheet 97 | */ 98 | - (void)ba_actionSheetHidden; 99 | 100 | @end 101 | 102 | @class BAActionSheetSubContentModel; 103 | @interface BAActionSheetModel : NSObject 104 | 105 | @property(nonatomic, copy) NSString *imageUrl; 106 | @property(nonatomic, copy) NSString *content; 107 | @property(nonatomic, copy) NSString *subContent; 108 | @property(nonatomic, strong) NSArray *subContentArray; 109 | 110 | @end 111 | 112 | @interface BAActionSheetSubContentModel : NSObject 113 | 114 | @property(nonatomic, copy) NSString *subContent; 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/BAActionSheet.m: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * @brief BAAlert 4 | * 5 | * @author BAHome 6 | * @copyright Copyright © 2016年 BAHome. All rights reserved. 7 | * @version V1.1.0 8 | */ 9 | 10 | #import "BAActionSheet.h" 11 | #import "BAActionSheetCell.h" 12 | #import "UIView+BAAnimation.h" 13 | #import "BAAlert_OC.h" 14 | 15 | static NSString * const kCellID = @"BAActionSheetCell"; 16 | 17 | @interface BAActionSheet () 18 | < 19 | UITableViewDelegate, 20 | UITableViewDataSource 21 | > 22 | /*! tableView */ 23 | @property (strong, nonatomic) UITableView *tableView; 24 | 25 | /*! 点击事件回调 */ 26 | @property (nonatomic, copy) BAActionSheet_ActionBlock actionBlock; 27 | 28 | @property (nonatomic, strong) UIWindow *actionSheetWindow; 29 | @property (nonatomic, strong) UIView *headerView; 30 | @property (nonatomic, strong) NSIndexPath *indexPath; 31 | @property (nonatomic, assign) BOOL isExpand; 32 | @property (nonatomic, strong) UILabel *titleLabel; 33 | @property(nonatomic, assign) BOOL isAnimating; 34 | 35 | @end 36 | 37 | @implementation BAActionSheet 38 | 39 | /*! 40 | * 41 | * @param configuration 属性配置:如 bgColor、buttonTitleColor、isTouchEdgeHide... 42 | * @param actionBlock block回调点击的选项 43 | */ 44 | + (void)ba_actionSheetShowWithConfiguration:(BAActionSheet_ConfigBlock)configuration 45 | actionBlock:(BAActionSheet_ActionBlock)actionBlock 46 | { 47 | BAActionSheet *actionSheet = [[self alloc] init]; 48 | 49 | if (configuration) 50 | { 51 | configuration(actionSheet); 52 | } 53 | actionSheet.actionBlock = actionBlock; 54 | [actionSheet ba_actionSheetShow]; 55 | } 56 | 57 | - (instancetype)init 58 | { 59 | self = [super init]; 60 | if (self) { 61 | [self setupCommonUI]; 62 | } 63 | return self; 64 | } 65 | 66 | - (instancetype)initWithFrame:(CGRect)frame 67 | { 68 | self = [super initWithFrame:frame]; 69 | if (self) { 70 | [self setupCommonUI]; 71 | } 72 | return self; 73 | } 74 | 75 | - (void)setupCommonUI 76 | { 77 | self.backgroundColor = BAKit_Color_Translucent_pod; 78 | self.actionSheetType = BAActionSheetTypeNormal; 79 | self.isExpand = NO; 80 | self.isTouchEdgeHide = YES; 81 | 82 | [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(handleDeviceOrientationRotateAction:) name:UIDeviceOrientationDidChangeNotification object:nil]; 83 | } 84 | 85 | #pragma mark - UITableView 86 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 87 | { 88 | if (self.actionSheetType == BAActionSheetTypeCustom) 89 | { 90 | return 2; 91 | } 92 | else if (self.actionSheetType == BAActionSheetTypeNormal) 93 | { 94 | return 1; 95 | } 96 | else if (self.actionSheetType == BAActionSheetTypeExpand) 97 | { 98 | return self.dataArray.count; 99 | } 100 | return 0; 101 | } 102 | 103 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 104 | { 105 | if (self.actionSheetType == BAActionSheetTypeCustom) 106 | { 107 | return (section == 0) ? self.dataArray.count : 1; 108 | } 109 | else if (self.actionSheetType == BAActionSheetTypeNormal) 110 | { 111 | return self.dataArray.count; 112 | } 113 | else if (self.actionSheetType == BAActionSheetTypeExpand) 114 | { 115 | if (self.isExpand) 116 | { 117 | if (section == self.indexPath.section) 118 | { 119 | BAActionSheetModel *model = self.dataArray[section]; 120 | 121 | return model.subContentArray.count; 122 | } 123 | } 124 | else 125 | { 126 | return 0; 127 | } 128 | } 129 | return 0; 130 | } 131 | 132 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 133 | { 134 | BAActionSheetCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellID]; 135 | 136 | if (!cell) 137 | { 138 | cell = [[BAActionSheetCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:kCellID]; 139 | } 140 | cell.actionSheetType = self.actionSheetType; 141 | 142 | if (self.actionSheetType == BAActionSheetTypeCustom) 143 | { 144 | if (indexPath.section == 0) 145 | { 146 | BAActionSheetModel *model = self.dataArray[indexPath.row]; 147 | cell.textLabel.text = model.content; 148 | } 149 | else if (indexPath.section == 1) 150 | { 151 | cell.textLabel.text = NSLocalizedString(@"取 消", @"取 消"); 152 | } 153 | cell.textLabel.textAlignment = NSTextAlignmentCenter; 154 | } 155 | else if (self.actionSheetType == BAActionSheetTypeNormal) 156 | { 157 | BAActionSheetModel *model = self.dataArray[indexPath.row]; 158 | cell.textLabel.text = model.content; 159 | cell.detailTextLabel.text = model.subContent; 160 | cell.imageView.image = [UIImage imageNamed:model.imageUrl]; 161 | cell.detailTextLabel.textColor = BAKit_Color_Gray_7_pod; 162 | 163 | if (indexPath.row == 0) 164 | { 165 | self.indexPath = indexPath; 166 | } 167 | 168 | if (self.indexPath == indexPath) 169 | { 170 | cell.accessoryType = UITableViewCellAccessoryCheckmark; 171 | } 172 | else 173 | { 174 | cell.accessoryType = UITableViewCellAccessoryNone; 175 | } 176 | 177 | } 178 | else if (self.actionSheetType == BAActionSheetTypeExpand) 179 | { 180 | if (self.isExpand) 181 | { 182 | BAActionSheetModel *model = self.dataArray[indexPath.section]; 183 | if (model.subContentArray.count) 184 | { 185 | BAActionSheetSubContentModel *subContentModel = model.subContentArray[indexPath.row]; 186 | cell.textLabel.text = subContentModel.subContent; 187 | cell.textLabel.textColor = BAKit_Color_Gray_7_pod; 188 | 189 | cell.backgroundColor = BAKit_Color_Gray_11_pod; 190 | 191 | return cell; 192 | } 193 | if (indexPath.row == model.subContentArray.count-1) 194 | { 195 | self.isExpand = NO; 196 | } 197 | } 198 | } 199 | return cell; 200 | } 201 | 202 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 203 | { 204 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 205 | 206 | if (self.actionSheetType == BAActionSheetTypeCustom) 207 | { 208 | if (indexPath.section == 0) 209 | { 210 | if (self.actionBlock) 211 | { 212 | [self ba_actionSheetHidden]; 213 | BAActionSheetModel *model = self.dataArray[indexPath.row]; 214 | 215 | self.actionBlock(indexPath, model); 216 | } 217 | } 218 | else if (indexPath.section == 1) 219 | { 220 | [self ba_actionSheetHidden]; 221 | } 222 | } 223 | else if (self.actionSheetType == BAActionSheetTypeNormal) 224 | { 225 | // 之前选中的,取消选择 226 | UITableViewCell *celled = [tableView cellForRowAtIndexPath:self.indexPath]; 227 | celled.accessoryType = UITableViewCellAccessoryNone; 228 | // 记录当前选中的位置索引 229 | self.indexPath = indexPath; 230 | // 当前选择的打勾 231 | UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; 232 | cell.accessoryType = UITableViewCellAccessoryCheckmark; 233 | 234 | if (self.actionBlock) 235 | { 236 | [self ba_actionSheetHidden]; 237 | BAActionSheetModel *model = self.dataArray[indexPath.row]; 238 | self.actionBlock(self.indexPath, model); 239 | } 240 | } 241 | else if (self.actionSheetType == BAActionSheetTypeExpand) 242 | { 243 | if (self.actionBlock) 244 | { 245 | [self ba_actionSheetHidden]; 246 | BAActionSheetModel *model = self.dataArray[indexPath.section]; 247 | 248 | self.actionBlock(indexPath, model); 249 | } 250 | } 251 | } 252 | 253 | - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath 254 | { 255 | if (self.actionSheetType == BAActionSheetTypeNormal) 256 | { 257 | UITableViewCell *cell = [self tableView:tableView cellForRowAtIndexPath:indexPath]; 258 | 259 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 260 | [self.tableView reloadData]; 261 | } 262 | } 263 | 264 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 265 | { 266 | return 44; 267 | } 268 | 269 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 270 | { 271 | if (self.actionSheetType == BAActionSheetTypeCustom) 272 | { 273 | return (section == 0) ? FLT_MIN : 10; 274 | } 275 | else if (self.actionSheetType == BAActionSheetTypeNormal) 276 | { 277 | return FLT_MIN; 278 | } 279 | else if (self.actionSheetType == BAActionSheetTypeExpand) 280 | { 281 | return 44; 282 | } 283 | else 284 | { 285 | return FLT_MIN; 286 | } 287 | } 288 | 289 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section 290 | { 291 | return FLT_MIN; 292 | } 293 | 294 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 295 | { 296 | if (self.actionSheetType == BAActionSheetTypeExpand) 297 | { 298 | BAActionSheetModel *model = self.dataArray[section]; 299 | 300 | UIButton *header = [UIButton new]; 301 | header.backgroundColor = [UIColor whiteColor]; 302 | header.userInteractionEnabled = YES; 303 | [header addTarget:self action:@selector(handleButtonAction:) forControlEvents:UIControlEventTouchUpInside]; 304 | header.tag = section; 305 | 306 | // NSString *imageName = @""; 307 | // imageName = @"BAAlert.bundle/Images/arow_down"; 308 | 309 | NSBundle *bundle; 310 | bundle = [NSBundle ba_bundleWithBundleName:@"BAAlert" podName:@"BAAlert"]; 311 | 312 | NSAssert(bundle, @"bundle 资源加载失败!"); 313 | UIImage *image; 314 | // image = [UIImage imageNamed:@"arow_down"]; 315 | image = [UIImage imageNamed:@"arow_down" inBundle:bundle compatibleWithTraitCollection:nil]; 316 | 317 | UIButton *expandButton = [UIButton buttonWithType:UIButtonTypeCustom]; 318 | [expandButton setImage:image forState:UIControlStateNormal]; 319 | expandButton.frame = CGRectMake(BAKit_SCREEN_WIDTH - 50, 0, 30, 30); 320 | expandButton.userInteractionEnabled = NO; 321 | 322 | UILabel *titleLabel = [UILabel new]; 323 | titleLabel.frame = CGRectMake(15, 0, BAKit_SCREEN_WIDTH - 15 * 2, 43); 324 | titleLabel.text = model.content; 325 | 326 | [header addSubview:titleLabel]; 327 | if (model.subContentArray.count > 0) 328 | { 329 | [header addSubview:expandButton]; 330 | } 331 | 332 | return header; 333 | } 334 | return [UIView new]; 335 | } 336 | 337 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 338 | { 339 | NSLog(@"触摸了边缘隐藏View!"); 340 | UITouch *touch = [touches anyObject]; 341 | UIView *view = [touch view]; 342 | 343 | if (self.isAnimating) 344 | { 345 | NSLog(@"请在动画结束时点击!"); 346 | return; 347 | } 348 | 349 | if (!self.isTouchEdgeHide) 350 | { 351 | NSLog(@"触摸了 View 边缘,但您未开启触摸边缘隐藏方法,请设置 isTouchEdgeHide 属性为 YES 后再使用!"); 352 | return; 353 | } 354 | 355 | if ([view isKindOfClass:[self class]]) 356 | { 357 | [self ba_actionSheetHidden]; 358 | } 359 | } 360 | 361 | - (void)handleDeviceOrientationRotateAction:(NSNotification *)noti 362 | { 363 | [self ba_layoutSubViews]; 364 | } 365 | 366 | - (void)layoutSubviews 367 | { 368 | [super layoutSubviews]; 369 | } 370 | 371 | - (void)ba_layoutSubViews 372 | { 373 | CGFloat min_x = 0; 374 | CGFloat min_y = 0; 375 | CGFloat min_w = 0; 376 | CGFloat min_h = 0; 377 | CGFloat header_h = 0; 378 | 379 | self.frame = [UIScreen mainScreen].bounds; 380 | 381 | min_w = BAKit_SCREEN_WIDTH; 382 | min_h = (self.title.length > 0) ? 44 : 0; 383 | self.headerView.frame = CGRectMake(min_x, min_y, min_w, min_h); 384 | _titleLabel.frame = self.headerView.bounds; 385 | 386 | 387 | header_h = CGRectGetHeight(self.headerView.frame); 388 | if (self.actionSheetType == BAActionSheetTypeCustom) 389 | { 390 | min_h = (self.dataArray.count + 1) * 44 + 10; 391 | } 392 | else if (self.actionSheetType == BAActionSheetTypeNormal) 393 | { 394 | min_h = (self.dataArray.count) * 44; 395 | } 396 | else if (self.actionSheetType == BAActionSheetTypeExpand) 397 | { 398 | if (self.isExpand) 399 | { 400 | BAActionSheetModel *model = self.dataArray[self.indexPath.section]; 401 | min_h = (self.dataArray.count + model.subContentArray.count) * 44; 402 | } 403 | else 404 | { 405 | min_h = (self.dataArray.count) * 44; 406 | } 407 | } 408 | min_y = BAKit_SCREEN_HEIGHT - min_h; 409 | min_y -= header_h; 410 | min_y = MAX(min_y, 0); 411 | min_h += header_h; 412 | min_h = MIN(min_h, BAKit_SCREEN_HEIGHT); 413 | if (min_h == BAKit_SCREEN_HEIGHT) 414 | { 415 | _tableView.scrollEnabled = YES; 416 | } 417 | self.tableView.frame = CGRectMake(min_x, min_y, min_w, min_h);; 418 | 419 | if (self.title.length > 0) 420 | { 421 | self.tableView.tableHeaderView = self.headerView; 422 | } 423 | self.tableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0); 424 | [self.tableView reloadData]; 425 | } 426 | 427 | - (void)ba_actionSheetShow 428 | { 429 | [self.actionSheetWindow addSubview:self]; 430 | 431 | [self ba_layoutSubViews]; 432 | 433 | /*! 设置默认样式为: */ 434 | if (self.isShowAnimate && !self.animatingStyle) 435 | { 436 | _animatingStyle = BAAlertAnimatingStyleScale; 437 | } 438 | /*! 如果没有开启动画,就直接默认第一个动画样式 */ 439 | else if (!self.isShowAnimate && self.animatingStyle) 440 | { 441 | self.showAnimate = YES; 442 | } 443 | else 444 | { 445 | if (!self.animatingStyle) 446 | { 447 | NSLog(@"您没有开启动画,也没有设置动画样式,默认为没有动画!"); 448 | } 449 | } 450 | 451 | if (self.isShowAnimate) 452 | { 453 | [self showAnimationWithView:self.tableView]; 454 | } 455 | } 456 | 457 | - (void)ba_actionSheetHidden 458 | { 459 | if (self.isShowAnimate) 460 | { 461 | [self dismissAnimationView:self.tableView]; 462 | } 463 | else 464 | { 465 | [self ba_removeSelf]; 466 | } 467 | } 468 | 469 | #pragma mark - 进场动画 470 | - (void )showAnimationWithView:(UIView *)animationView 471 | { 472 | self.isAnimating = YES; 473 | BAKit_WeakSelf 474 | if (self.animatingStyle == BAAlertAnimatingStyleScale) 475 | { 476 | [animationView ba_animation_scaleShowWithDuration:0.5 ratio:1.1 finishBlock:^{ 477 | BAKit_StrongSelf 478 | self.isAnimating = NO; 479 | }]; 480 | 481 | } 482 | else if (self.animatingStyle == BAAlertAnimatingStyleShake) 483 | { 484 | [animationView ba_animation_showFromPositionType:BAKit_ViewAnimationEnterDirectionTypeTop duration:0.5 finishBlock:^{ 485 | BAKit_StrongSelf 486 | self.isAnimating = NO; 487 | }]; 488 | 489 | } 490 | else if (self.animatingStyle == BAAlertAnimatingStyleFall) 491 | { 492 | [animationView ba_animation_showFromPositionType:BAKit_ViewAnimationEnterDirectionTypeBottom duration:0.5 finishBlock:^{ 493 | BAKit_StrongSelf 494 | self.isAnimating = NO; 495 | }]; 496 | } 497 | } 498 | 499 | #pragma mark - 出场动画 500 | - (void )dismissAnimationView:(UIView *)animationView 501 | { 502 | self.isAnimating = YES; 503 | BAKit_WeakSelf; 504 | if (self.animatingStyle == BAAlertAnimatingStyleScale) 505 | { 506 | [animationView ba_animation_scaleDismissWithDuration:0.5 ratio:1.1 finishBlock:^{ 507 | BAKit_StrongSelf 508 | self.isAnimating = NO; 509 | [self performSelector:@selector(ba_removeSelf)]; 510 | }]; 511 | 512 | } 513 | else if (self.animatingStyle == BAAlertAnimatingStyleShake) 514 | { 515 | [animationView ba_animation_dismissFromPositionType:BAKit_ViewAnimationEnterDirectionTypeLeft duration:0.5 finishBlock:^{ 516 | BAKit_StrongSelf 517 | self.isAnimating = NO; 518 | [self performSelector:@selector(ba_removeSelf)]; 519 | }]; 520 | } 521 | else if (self.animatingStyle == BAAlertAnimatingStyleFall) 522 | { 523 | [animationView ba_animation_dismissFromPositionType:BAKit_ViewAnimationEnterDirectionTypeBottom duration:0.5 finishBlock:^{ 524 | BAKit_StrongSelf 525 | self.isAnimating = NO; 526 | [self performSelector:@selector(ba_removeSelf)]; 527 | }]; 528 | } 529 | } 530 | 531 | - (void)ba_removeSelf 532 | { 533 | [self.tableView removeFromSuperview]; 534 | self.tableView = nil; 535 | [self removeFromSuperview]; 536 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 537 | } 538 | 539 | - (void)handleButtonAction:(UIButton *)sender 540 | { 541 | BAActionSheetModel *model = self.dataArray[sender.tag]; 542 | for (NSInteger i = 0; i < model.subContentArray.count; i++) 543 | { 544 | self.indexPath = [NSIndexPath indexPathForRow:i inSection:sender.tag]; 545 | } 546 | 547 | if (model.subContentArray.count > 0) 548 | { 549 | self.isExpand = !self.isExpand; 550 | } 551 | else 552 | { 553 | self.isExpand = NO; 554 | if (self.actionBlock) 555 | { 556 | [self ba_actionSheetHidden]; 557 | BAActionSheetModel *model = self.dataArray[sender.tag]; 558 | 559 | self.actionBlock(self.indexPath, model); 560 | } 561 | } 562 | 563 | [self ba_layoutSubViews]; 564 | 565 | [self.tableView reloadData]; 566 | } 567 | 568 | #pragma mark - setter / getter 569 | - (UITableView *)tableView 570 | { 571 | if ( !_tableView ) 572 | { 573 | _tableView = [[UITableView alloc] init]; 574 | _tableView.delegate = self; 575 | _tableView.dataSource = self; 576 | _tableView.scrollEnabled = NO; 577 | _tableView.backgroundColor = BAKit_Color_Gray_11_pod; 578 | 579 | [self addSubview:_tableView]; 580 | } 581 | return _tableView; 582 | } 583 | 584 | - (UIView *)headerView 585 | { 586 | if (!_headerView) 587 | { 588 | _headerView = [UIView new]; 589 | 590 | _titleLabel = [UILabel new]; 591 | _titleLabel.textAlignment = NSTextAlignmentCenter; 592 | _titleLabel.text = self.title; 593 | 594 | [self.headerView addSubview:_titleLabel]; 595 | } 596 | return _headerView; 597 | } 598 | 599 | - (UIWindow *)actionSheetWindow 600 | { 601 | if (!_actionSheetWindow) 602 | { 603 | _actionSheetWindow = [UIApplication sharedApplication].keyWindow; 604 | 605 | if (self.actionSheetWindow.windowLevel != UIWindowLevelNormal) 606 | { 607 | NSPredicate *predicate = [NSPredicate predicateWithFormat:@"windowLevel == %ld AND hidden == 0 " , UIWindowLevelNormal]; 608 | self.actionSheetWindow = [[UIApplication sharedApplication].windows filteredArrayUsingPredicate:predicate].firstObject; 609 | } 610 | self.actionSheetWindow.backgroundColor = BAKit_Color_Translucent_pod; 611 | } 612 | 613 | return _actionSheetWindow; 614 | } 615 | 616 | - (void)setIsTouchEdgeHide:(BOOL)isTouchEdgeHide 617 | { 618 | _isTouchEdgeHide = isTouchEdgeHide; 619 | } 620 | 621 | - (void)setShowAnimate:(BOOL)showAnimate 622 | { 623 | _showAnimate = showAnimate; 624 | } 625 | 626 | - (void)setAnimatingStyle:(BAAlertAnimatingStyle)animatingStyle 627 | { 628 | _animatingStyle = animatingStyle; 629 | } 630 | 631 | - (void)setActionSheetType:(BAActionSheetType)actionSheetType 632 | { 633 | _actionSheetType = actionSheetType; 634 | } 635 | 636 | - (void)setIsAnimating:(BOOL)isAnimating 637 | { 638 | _isAnimating = isAnimating; 639 | } 640 | 641 | @end 642 | 643 | @implementation BAActionSheetModel 644 | 645 | @end 646 | 647 | @implementation BAActionSheetSubContentModel 648 | 649 | @end 650 | -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/BAActionSheetCell.h: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * @header BAKit.h 4 | * 5 | * @brief BAKit 6 | * 7 | * @author 博爱 8 | * @copyright Copyright © 2016年 博爱. All rights reserved. 9 | * @version V1.0 10 | */ 11 | 12 | // _ooOoo_ 13 | // o8888888o 14 | // 88" . "88 15 | // (| -_- |) 16 | // O\ = /O 17 | // ____/`---'\____ 18 | // . ' \\| |// `. 19 | // / \\||| : |||// \ 20 | // / _||||| -:- |||||- \ 21 | // | | \\\ - /// | | 22 | // | \_| ''\---/'' | | 23 | // \ .-\__ `-` ___/-. / 24 | // ___`. .' /--.--\ `. . __ 25 | // ."" '< `.___\_<|>_/___.' >'"". 26 | // | | : `- \`.;`\ _ /`;.`/ - ` : | | 27 | // \ \ `-. \_ __\ /__ _/ .-` / / 28 | // ======`-.____`-.___\_____/___.-`____.-'====== 29 | // `=---=' 30 | // 31 | // ............................................. 32 | // 佛祖镇楼 BUG辟易 33 | // 佛曰: 34 | // 写字楼里写字间,写字间里程序员; 35 | // 程序人员写程序,又拿程序换酒钱。 36 | // 酒醒只在网上坐,酒醉还来网下眠; 37 | // 酒醉酒醒日复日,网上网下年复年。 38 | // 但愿老死电脑间,不愿鞠躬老板前; 39 | // 奔驰宝马贵者趣,公交自行程序员。 40 | // 别人笑我忒疯癫,我笑自己命太贱; 41 | // 不见满街漂亮妹,哪个归得程序员? 42 | 43 | /* 44 | 45 | ********************************************************************************* 46 | * 47 | * 在使用 BAKit 的过程中如果出现 bug 请及时以以下任意一种方式联系我,我会及时修复 bug 48 | * 49 | * QQ : 可以添加ios开发技术群 479663605 在这里找到我(博爱1616【137361770】) 50 | * 微博 : 博爱1616 51 | * Email : 137361770@qq.com 52 | * GitHub : https://github.com/boai 53 | * BAHome : https://github.com/BAHome 54 | * 博客 : http://boaihome.com 55 | 56 | ********************************************************************************* 57 | 58 | */ 59 | 60 | #import 61 | #import "BAAlert_Config.h" 62 | 63 | @interface BAActionSheetCell : UITableViewCell 64 | 65 | /*! BAActionSheet 类型,默认:1 */ 66 | @property (nonatomic, assign) BAActionSheetType actionSheetType; 67 | 68 | 69 | @end 70 | 71 | -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/BAActionSheetCell.m: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * @brief BAAlert 4 | * 5 | * @author BAHome 6 | * @copyright Copyright © 2016年 BAHome. All rights reserved. 7 | * @version V1.1.0 8 | */ 9 | 10 | #import "BAActionSheetCell.h" 11 | 12 | @implementation BAActionSheetCell 13 | 14 | - (void)layoutSubviews { 15 | [super layoutSubviews]; 16 | 17 | CGFloat min_x = 0; 18 | CGFloat min_y = 0; 19 | CGFloat min_w = 0; 20 | CGFloat min_h = 0; 21 | 22 | if (self.actionSheetType == BAActionSheetTypeNormal) 23 | { 24 | min_x = 15; 25 | min_w = 30; 26 | min_y = 7; 27 | min_h = min_w; 28 | self.imageView.frame = CGRectMake(min_x, min_y, min_w, min_h); 29 | 30 | min_w = CGRectGetWidth(self.frame) - CGRectGetMaxX(self.imageView.frame) - 15 * 2; 31 | if (self.imageView.image.size.width > 0) 32 | { 33 | min_x = CGRectGetMaxX(self.imageView.frame) + 10; 34 | } 35 | min_y = 0; 36 | min_h = CGRectGetHeight(self.frame); 37 | if (self.detailTextLabel.text.length > 0) 38 | { 39 | min_y = 5; 40 | min_h = CGRectGetHeight(self.frame)/2 - 5; 41 | } 42 | self.textLabel.frame = CGRectMake(min_x, min_y, min_w, min_h); 43 | min_y = CGRectGetMaxY(self.textLabel.frame); 44 | self.detailTextLabel.frame = CGRectMake(min_x, min_y, min_w, min_h); 45 | } 46 | else if (self.actionSheetType == BAActionSheetTypeCustom) 47 | { 48 | min_x = 15; 49 | min_w = CGRectGetWidth(self.frame) - 15 * 2; 50 | min_y = 0; 51 | min_h = CGRectGetHeight(self.frame); 52 | self.textLabel.frame = CGRectMake(min_x, min_y, min_w, min_h); 53 | } 54 | } 55 | 56 | - (void)setActionSheetType:(BAActionSheetType)actionSheetType 57 | { 58 | _actionSheetType = actionSheetType; 59 | } 60 | 61 | @end 62 | 63 | -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/BAAlert.h: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * @header BAKit.h 4 | * 5 | * @brief BAKit 6 | * 7 | * @author 博爱 8 | * @copyright Copyright © 2016年 博爱. All rights reserved. 9 | * @version V1.0 10 | */ 11 | 12 | // _ooOoo_ 13 | // o8888888o 14 | // 88" . "88 15 | // (| -_- |) 16 | // O\ = /O 17 | // ____/`---'\____ 18 | // . ' \\| |// `. 19 | // / \\||| : |||// \ 20 | // / _||||| -:- |||||- \ 21 | // | | \\\ - /// | | 22 | // | \_| ''\---/'' | | 23 | // \ .-\__ `-` ___/-. / 24 | // ___`. .' /--.--\ `. . __ 25 | // ."" '< `.___\_<|>_/___.' >'"". 26 | // | | : `- \`.;`\ _ /`;.`/ - ` : | | 27 | // \ \ `-. \_ __\ /__ _/ .-` / / 28 | // ======`-.____`-.___\_____/___.-`____.-'====== 29 | // `=---=' 30 | // 31 | // ............................................. 32 | // 佛祖镇楼 BUG辟易 33 | // 佛曰: 34 | // 写字楼里写字间,写字间里程序员; 35 | // 程序人员写程序,又拿程序换酒钱。 36 | // 酒醒只在网上坐,酒醉还来网下眠; 37 | // 酒醉酒醒日复日,网上网下年复年。 38 | // 但愿老死电脑间,不愿鞠躬老板前; 39 | // 奔驰宝马贵者趣,公交自行程序员。 40 | // 别人笑我忒疯癫,我笑自己命太贱; 41 | // 不见满街漂亮妹,哪个归得程序员? 42 | 43 | /* 44 | 45 | ********************************************************************************* 46 | * 47 | * 在使用 BAKit 的过程中如果出现 bug 请及时以以下任意一种方式联系我,我会及时修复 bug 48 | * 49 | * QQ : 可以添加ios开发技术群 479663605 在这里找到我(博爱1616【137361770】) 50 | * 微博 : 博爱1616 51 | * Email : 137361770@qq.com 52 | * GitHub : https://github.com/boai 53 | * BAHome : https://github.com/BAHome 54 | * 博客 : http://boaihome.com 55 | 56 | ********************************************************************************* 57 | 58 | */ 59 | 60 | 61 | #import 62 | #import "BAAlert_Config.h" 63 | 64 | @class BAAlert; 65 | 66 | typedef void(^BAAlert_ConfigBlock)(BAAlert *tempView); 67 | typedef void(^BAAlert_ButtonActionBlock)(BAAlert *tempView, NSInteger index); 68 | 69 | @interface BAAlert : UIView 70 | 71 | /*! 背景颜色 默认:半透明*/ 72 | @property (nonatomic, strong) UIColor *bgColor; 73 | 74 | /*! 是否开启边缘触摸隐藏 alert 默认:NO */ 75 | @property (nonatomic, assign) BOOL isTouchEdgeHide; 76 | 77 | /*! 背景图片名字 默认:没有图片*/ 78 | @property (nonatomic, strong) NSString *bgImageName; 79 | 80 | /*! 是否开启进出场动画 默认:NO,如果 YES ,并且同步设置进出场动画枚举为默认值:1 */ 81 | @property (nonatomic, assign, getter=isShowAnimate) BOOL showAnimate; 82 | 83 | /*! 进出场动画枚举 默认:1 ,并且默认开启动画开关 */ 84 | @property (nonatomic, assign) BAAlertAnimatingStyle animatingStyle; 85 | 86 | /*! 背景高斯模糊枚举 默认:没有模糊效果 */ 87 | @property (nonatomic, assign) BAAlertBlurEffectStyle blurEffectStyle; 88 | 89 | /*! 是否需要开启键盘自适应 默认:NO,注意:如果用了第三方键盘适配的话,可以将此属性设置为 NO!以免冲突 */ 90 | @property(nonatomic, assign) BOOL isNeedAutoKeyboardFrame; 91 | 92 | /*! 进场动画持续时间 默认:0.5f */ 93 | @property (nonatomic, assign) double startAnimationDuration; 94 | 95 | /*! 出场动画持续时间 默认:0.5f */ 96 | @property (nonatomic, assign) double endAnimationDuration; 97 | 98 | /*! 99 | * 创建一个完全自定义的 alertView 100 | * 101 | * @param customView 自定义 View 102 | * @param configuration 属性配置:如 bgColor、buttonTitleColor、isTouchEdgeHide... 103 | */ 104 | + (void)ba_alertShowCustomView:(UIView *)customView 105 | configuration:(BAAlert_ConfigBlock) configuration; 106 | 107 | /*! 108 | * 创建一个类似于系统的alert 109 | * 110 | * @param title 标题:可空 111 | * @param message 消息内容:可空 112 | * @param image 图片:可空 113 | * @param buttonTitleArray 按钮标题:不可空 114 | * @param buttonTitleColorArray 按钮标题颜色:可空,默认蓝色 115 | * @param configuration 属性配置:如 bgColor、buttonTitleColor、isTouchEdgeHide... 116 | * @param actionBlock 按钮的点击事件处理 117 | */ 118 | + (void)ba_alertShowWithTitle:(NSString *)title 119 | message:(NSString *)message 120 | image:(UIImage *)image 121 | buttonTitleArray:(NSArray *)buttonTitleArray 122 | buttonTitleColorArray:(NSArray *)buttonTitleColorArray 123 | configuration:(BAAlert_ConfigBlock)configuration 124 | actionBlock:(BAAlert_ButtonActionBlock)actionBlock; 125 | 126 | /*! 127 | * 视图消失 128 | */ 129 | - (void)ba_alertHidden; 130 | 131 | @end 132 | -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/BAAlert_Config.h: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * @header BAKit.h 4 | * 5 | * @brief BAKit 6 | * 7 | * @author 博爱 8 | * @copyright Copyright © 2016年 博爱. All rights reserved. 9 | * @version V1.0 10 | */ 11 | 12 | // _ooOoo_ 13 | // o8888888o 14 | // 88" . "88 15 | // (| -_- |) 16 | // O\ = /O 17 | // ____/`---'\____ 18 | // . ' \\| |// `. 19 | // / \\||| : |||// \ 20 | // / _||||| -:- |||||- \ 21 | // | | \\\ - /// | | 22 | // | \_| ''\---/'' | | 23 | // \ .-\__ `-` ___/-. / 24 | // ___`. .' /--.--\ `. . __ 25 | // ."" '< `.___\_<|>_/___.' >'"". 26 | // | | : `- \`.;`\ _ /`;.`/ - ` : | | 27 | // \ \ `-. \_ __\ /__ _/ .-` / / 28 | // ======`-.____`-.___\_____/___.-`____.-'====== 29 | // `=---=' 30 | // 31 | // ............................................. 32 | // 佛祖镇楼 BUG辟易 33 | // 佛曰: 34 | // 写字楼里写字间,写字间里程序员; 35 | // 程序人员写程序,又拿程序换酒钱。 36 | // 酒醒只在网上坐,酒醉还来网下眠; 37 | // 酒醉酒醒日复日,网上网下年复年。 38 | // 但愿老死电脑间,不愿鞠躬老板前; 39 | // 奔驰宝马贵者趣,公交自行程序员。 40 | // 别人笑我忒疯癫,我笑自己命太贱; 41 | // 不见满街漂亮妹,哪个归得程序员? 42 | 43 | /* 44 | 45 | ********************************************************************************* 46 | * 47 | * 在使用 BAKit 的过程中如果出现 bug 请及时以以下任意一种方式联系我,我会及时修复 bug 48 | * 49 | * QQ : 可以添加ios开发技术群 479663605 在这里找到我(博爱1616【137361770】) 50 | * 微博 : 博爱1616 51 | * Email : 137361770@qq.com 52 | * GitHub : https://github.com/boai 53 | * BAHome : https://github.com/BAHome 54 | * 博客 : http://boaihome.com 55 | 56 | ********************************************************************************* 57 | 58 | */ 59 | 60 | 61 | #ifndef BAAlert_Config_h 62 | #define BAAlert_Config_h 63 | 64 | /*! 背景高斯模糊枚举 默认:1 */ 65 | typedef NS_ENUM(NSInteger, BAAlertBlurEffectStyle) { 66 | /*! 较亮的白色模糊 */ 67 | BAAlertBlurEffectStyleExtraLight = 1, 68 | /*! 一般亮的白色模糊 */ 69 | BAAlertBlurEffectStyleLight, 70 | /*! 深色背景模糊 */ 71 | BAAlertBlurEffectStyleDark 72 | } NS_ENUM_AVAILABLE_IOS(7_0); 73 | 74 | /*! 进出场动画枚举 默认:1 */ 75 | typedef NS_ENUM(NSUInteger, BAAlertAnimatingStyle) { 76 | /*! 缩放显示动画 */ 77 | BAAlertAnimatingStyleScale = 1, 78 | /*! 晃动动画 */ 79 | BAAlertAnimatingStyleShake, 80 | /*! 天上掉下动画 / 上升动画 */ 81 | BAAlertAnimatingStyleFall 82 | }; 83 | 84 | /*! BAActionSheet 类型,默认:1 */ 85 | typedef NS_ENUM(NSUInteger, BAActionSheetType) { 86 | BAActionSheetTypeNormal = 1, 87 | BAActionSheetTypeCustom, 88 | BAActionSheetTypeExpand 89 | }; 90 | 91 | #endif /* BAAlert_Config_h */ 92 | -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/BAAlert_OC.h: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * @header BAKit.h 4 | * BABaseProject 5 | * 6 | * @brief BAKit 7 | * 8 | * @author 博爱 9 | * @copyright Copyright © 2016年 博爱. All rights reserved. 10 | * @version V1.0 11 | */ 12 | 13 | // _ooOoo_ 14 | // o8888888o 15 | // 88" . "88 16 | // (| -_- |) 17 | // O\ = /O 18 | // ____/`---'\____ 19 | // . ' \\| |// `. 20 | // / \\||| : |||// \ 21 | // / _||||| -:- |||||- \ 22 | // | | \\\ - /// | | 23 | // | \_| ''\---/'' | | 24 | // \ .-\__ `-` ___/-. / 25 | // ___`. .' /--.--\ `. . __ 26 | // ."" '< `.___\_<|>_/___.' >'"". 27 | // | | : `- \`.;`\ _ /`;.`/ - ` : | | 28 | // \ \ `-. \_ __\ /__ _/ .-` / / 29 | // ======`-.____`-.___\_____/___.-`____.-'====== 30 | // `=---=' 31 | // 32 | // ............................................. 33 | // 佛祖镇楼 BUG辟易 34 | // 佛曰: 35 | // 写字楼里写字间,写字间里程序员; 36 | // 程序人员写程序,又拿程序换酒钱。 37 | // 酒醒只在网上坐,酒醉还来网下眠; 38 | // 酒醉酒醒日复日,网上网下年复年。 39 | // 但愿老死电脑间,不愿鞠躬老板前; 40 | // 奔驰宝马贵者趣,公交自行程序员。 41 | // 别人笑我忒疯癫,我笑自己命太贱; 42 | // 不见满街漂亮妹,哪个归得程序员? 43 | 44 | /* 45 | 46 | ********************************************************************************* 47 | * 48 | * 在使用BAKit的过程中如果出现bug请及时以以下任意一种方式联系我,我会及时修复bug 49 | * 50 | * QQ : 可以添加ios开发技术群 479663605 在这里找到我(博爱1616【137361770】) 51 | * 微博 : 博爱1616 52 | * Email : 137361770@qq.com 53 | * GitHub : https://github.com/boai 54 | * 博客 : http://boaihome.com 55 | 56 | ********************************************************************************* 57 | 58 | */ 59 | 60 | 61 | #ifndef BAAlert_OC_h 62 | #define BAAlert_OC_h 63 | 64 | #import "BAAlert.h" 65 | #import "BAActionSheet.h" 66 | #import "BAKit_ConfigurationDefine.h" 67 | #import "CALayer+BAAnimation.h" 68 | #import "UIView+BAAnimation.h" 69 | #import "NSBundle+BAPod.h" 70 | 71 | 72 | #endif /* BAAlert_OC_h */ 73 | -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/BAAlert_Version.h: -------------------------------------------------------------------------------- 1 | // 2 | // BAAlert_Version.h 3 | // BAAlert 4 | // 5 | // Created by boai on 2017/10/30. 6 | // Copyright © 2017年 boai. All rights reserved. 7 | // 8 | 9 | #ifndef BAAlert_Version_h 10 | #define BAAlert_Version_h 11 | 12 | /*! 13 | ********************************************************************************* 14 | ************************************ 更新说明 ************************************ 15 | ********************************************************************************* 16 | 17 | 欢迎使用 BAHome 系列开源代码 ! 18 | 如有更多需求,请前往:https://github.com/BAHome 19 | 20 | 项目源码地址: 21 | OC 版 :https://github.com/BAHome/BAAlert 22 | 系统原生 UIAlertController 分类封装:https://github.com/BAHome/BAAlertController 23 | 24 | 最新更新时间:2018-11-14 【倒叙】
25 | 最新Version:【Version:1.2.7】
26 | 更新内容:
27 | 1.2.7.1、官方 pod 标准版本 demo 全新适配,支持本地调试
28 | 1.2.7.2、公开 `#import "UIView+BAAnimation.h"` 文件
29 | 30 | 最新更新时间:2018-04-12 【倒叙】
31 | 最新Version:【Version:1.2.6】
32 | 更新内容:
33 | 1.2.6.1、新增 进场动画持续时间 默认:0.5f (startAnimationDuration/endAnimationDuration)
34 | 1.2.6.2、优化部分动画封装
35 | 36 | 最新更新时间:2017-10-30 【倒叙】
37 | 最新Version:【Version:1.2.5】
38 | 更新内容:
39 | 1.2.5.1、修复 isTouchEdgeHide 属性设置为 NO 的时候,无效的bug(感谢群里 [@北京-菲菲] 同学提出的 bug!)
40 | 1.2.5.2、修复 键盘弹出的时候,点击背景隐藏 alert 的时候,键盘偶尔消失不了的bug(感谢群里 [@广州-王培] 同学提出的 bug!)
41 | 1.2.5.3、新增 isNeedAutoKeyboardFrame 属性,是否需要开启键盘自适应 默认:NO,注意:如果用了第三方键盘适配的话,可以将此属性设置为 NO!以免冲突
42 | 43 | 最新更新时间:2017-08-21 【倒叙】
44 | 最新Version:【Version:1.2.4】
45 | 更新内容:
46 | 1.2.4.1、修复 自定义背景图片不显示的问题(感谢群里 [@北京-邵峰] 同学提出的 bug!)
47 | 48 | 最新更新时间:2017-08-18 【倒叙】
49 | 最新Version:【Version:1.2.3】
50 | 更新内容:
51 | 1.2.3.1、优化自定义 alert 的布局,横竖屏可以适配了!
52 | 53 | 最新更新时间:2017-06-23 【倒叙】
54 | 最新Version:【Version:1.2.2】
55 | 更新内容:
56 | 1.2.2.1、优化部分宏定义
57 | 58 | 最新更新时间:2017-06-19 【倒叙】
59 | 最新Version:【Version:1.2.0】
60 | 更新内容:
61 | 1.2.0.1、统一全局宏定义文件,优化代码规范
62 | 63 | 最新更新时间:2017-05-20 【倒叙】
64 | 最新Version:【Version:1.1.9】
65 | 更新内容:
66 | 1.1.9.1、修复动画过度白屏问题
67 | 68 | 最新更新时间:2017-05-15 【倒叙】
69 | 最新Version:【Version:1.1.8】
70 | 更新内容:
71 | 1.1.8.1、精简代码结构,删除多余或者重复代码
72 | 1.1.8.2、规范代码属性和方法命名,原有方法名和属性名有较大改动,忘见谅
73 | 1.1.8.3、重构 actionSheet,新增多种样式
74 | 75 | 最新更新时间:2017-05-13 【倒叙】
76 | 最新Version:【Version:1.1.7】
77 | 更新内容:
78 | 1.1.7.1、精简代码结构,删除多余或者重复代码
79 | 1.1.7.2、规范代码属性和方法命名,原有方法名和属性名有较大改动,忘见谅
80 | 1.1.7.3、优化部分动画
81 | 1.1.7.4、subView 布局优化
82 | 1.1.7.5、actionSheet 新增自定义文字颜色、title 字体颜色
83 | 84 | 最新更新时间:2017-05-10 【倒叙】
85 | 最新Version:【Version:1.1.5】
86 | 更新内容:
87 | 1.1.5.1、删除原有封装内部按钮点击事件中 ba_dismissAlertView 方法,此方法可在外部自由调用
88 | 89 | 最新更新时间:2017-05-09 【倒叙】
90 | 最新Version:【Version:1.1.4】
91 | 更新内容:
92 | 1.1.4.1、pod 更新xib 文件
93 | 94 | 最新更新时间:2017-05-08 【倒叙】 95 | 最新Version:【Version:1.1.0】 96 | 更新内容: 97 | 1.1.0.1、优化方法名命名规范 98 | 1.1.0.2、新增键盘内部处理 99 | 1.1.0.3、用原生 autoLayout 重构,自定义 alert 的布局再也不是问题了 100 | 1.1.0.4、优化代码结构,修复内在隐藏内存泄漏 101 | 1.1.0.5、新增 BAAlert_OC.h 文件,只需导入 BAAlert_OC.h 一个文件就可以使用 alert 和 actionSheet 了 102 | 1.1.0.6、删除了部分代码和属性,具体见源码 和 demo 103 | 104 | */ 105 | 106 | #endif /* BAAlert_Version_h */ 107 | -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/BAKit_ConfigurationDefine.h: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * @header BAKit.h 4 | * 5 | * @brief BAKit 6 | * 7 | * @author 博爱 8 | * @copyright Copyright © 2016年 博爱. All rights reserved. 9 | * @version V1.0 10 | */ 11 | 12 | // _ooOoo_ 13 | // o8888888o 14 | // 88" . "88 15 | // (| -_- |) 16 | // O\ = /O 17 | // ____/`---'\____ 18 | // . ' \\| |// `. 19 | // / \\||| : |||// \ 20 | // / _||||| -:- |||||- \ 21 | // | | \\\ - /// | | 22 | // | \_| ''\---/'' | | 23 | // \ .-\__ `-` ___/-. / 24 | // ___`. .' /--.--\ `. . __ 25 | // ."" '< `.___\_<|>_/___.' >'"". 26 | // | | : `- \`.;`\ _ /`;.`/ - ` : | | 27 | // \ \ `-. \_ __\ /__ _/ .-` / / 28 | // ======`-.____`-.___\_____/___.-`____.-'====== 29 | // `=---=' 30 | // 31 | // ............................................. 32 | // 佛祖镇楼 BUG辟易 33 | // 佛曰: 34 | // 写字楼里写字间,写字间里程序员; 35 | // 程序人员写程序,又拿程序换酒钱。 36 | // 酒醒只在网上坐,酒醉还来网下眠; 37 | // 酒醉酒醒日复日,网上网下年复年。 38 | // 但愿老死电脑间,不愿鞠躬老板前; 39 | // 奔驰宝马贵者趣,公交自行程序员。 40 | // 别人笑我忒疯癫,我笑自己命太贱; 41 | // 不见满街漂亮妹,哪个归得程序员? 42 | 43 | /* 44 | 45 | ********************************************************************************* 46 | * 47 | * 在使用 BAKit 的过程中如果出现 bug 请及时以以下任意一种方式联系我,我会及时修复 bug 48 | * 49 | * QQ : 可以添加ios开发技术群 479663605 在这里找到我(博爱1616【137361770】) 50 | * 微博 : 博爱1616 51 | * Email : 137361770@qq.com 52 | * GitHub : https://github.com/boai 53 | * BAHome : https://github.com/BAHome 54 | * 博客 : http://boaihome.com 55 | 56 | ********************************************************************************* 57 | 58 | */ 59 | 60 | 61 | #ifndef BAKit_ConfigurationDefine_h 62 | #define BAKit_ConfigurationDefine_h 63 | 64 | 65 | #ifndef __OPTIMIZE__ 66 | #define NSLog(...) NSLog(__VA_ARGS__) 67 | #else 68 | #define NSLog(...){} 69 | #endif 70 | 71 | #pragma mark - weak / strong 72 | #define BAKit_WeakSelf @BAKit_Weakify(self); 73 | #define BAKit_StrongSelf @BAKit_Strongify(self); 74 | 75 | /*! 76 | * 强弱引用转换,用于解决代码块(block)与强引用self之间的循环引用问题 77 | * 调用方式: `@BAKit_Weakify`实现弱引用转换,`@BAKit_Strongify`实现强引用转换 78 | * 79 | * 示例: 80 | * @BAKit_Weakify 81 | * [obj block:^{ 82 | * @strongify_self 83 | * self.property = something; 84 | * }]; 85 | */ 86 | #ifndef BAKit_Weakify 87 | #if DEBUG 88 | #if __has_feature(objc_arc) 89 | #define BAKit_Weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object; 90 | #else 91 | #define BAKit_Weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object; 92 | #endif 93 | #else 94 | #if __has_feature(objc_arc) 95 | #define BAKit_Weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object; 96 | #else 97 | #define BAKit_Weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object; 98 | #endif 99 | #endif 100 | #endif 101 | 102 | /*! 103 | * 强弱引用转换,用于解决代码块(block)与强引用对象之间的循环引用问题 104 | * 调用方式: `@BAKit_Weakify(object)`实现弱引用转换,`@BAKit_Strongify(object)`实现强引用转换 105 | * 106 | * 示例: 107 | * @BAKit_Weakify(object) 108 | * [obj block:^{ 109 | * @BAKit_Strongify(object) 110 | * strong_object = something; 111 | * }]; 112 | */ 113 | #ifndef BAKit_Strongify 114 | #if DEBUG 115 | #if __has_feature(objc_arc) 116 | #define BAKit_Strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object; 117 | #else 118 | #define BAKit_Strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object; 119 | #endif 120 | #else 121 | #if __has_feature(objc_arc) 122 | #define BAKit_Strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object; 123 | #else 124 | #define BAKit_Strongify(object) try{} @finally{} __typeof__(object) object = block##_##object; 125 | #endif 126 | #endif 127 | #endif 128 | 129 | /*! 获取sharedApplication */ 130 | #define BAKit_SharedApplication [UIApplication sharedApplication] 131 | 132 | // 操作系统版本号 133 | #define BAKit_IOS_VERSION ([[[UIDevice currentDevice] systemVersion] floatValue]) 134 | 135 | /*! 主线程同步队列 */ 136 | #define dispatch_main_sync_safe(block)\ 137 | if ([NSThread isMainThread]) {\ 138 | block();\ 139 | } else {\ 140 | dispatch_sync(dispatch_get_main_queue(), block);\ 141 | } 142 | /*! 主线程异步队列 */ 143 | #define dispatch_main_async_safe(block)\ 144 | if ([NSThread isMainThread]) {\ 145 | block();\ 146 | } else {\ 147 | dispatch_async(dispatch_get_main_queue(), block);\ 148 | } 149 | 150 | 151 | #pragma mark - runtime 152 | #import 153 | /*! runtime set */ 154 | #define BAKit_Objc_setObj(key, value) objc_setAssociatedObject(self, key, value, OBJC_ASSOCIATION_RETAIN_NONATOMIC) 155 | 156 | /*! runtime setCopy */ 157 | #define BAKit_Objc_setObjCOPY(key, value) objc_setAssociatedObject(self, key, value, OBJC_ASSOCIATION_COPY) 158 | 159 | /*! runtime get */ 160 | #define BAKit_Objc_getObj objc_getAssociatedObject(self, _cmd) 161 | 162 | /*! runtime exchangeMethod */ 163 | #define BAKit_Objc_exchangeMethodAToB(originalSelector,swizzledSelector) { \ 164 | Method originalMethod = class_getInstanceMethod(self, originalSelector); \ 165 | Method swizzledMethod = class_getInstanceMethod(self, swizzledSelector); \ 166 | if (class_addMethod(self, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { \ 167 | class_replaceMethod(self, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); \ 168 | } else { \ 169 | method_exchangeImplementations(originalMethod, swizzledMethod); \ 170 | } \ 171 | } 172 | 173 | #pragma mark - 简单警告框 174 | /*! view 用 BAKit_ShowAlertWithMsg */ 175 | #define BAKit_ShowAlertWithMsg(msg) [[[UIAlertView alloc] initWithTitle:@"温馨提示" message:(msg) delegate:nil cancelButtonTitle:@"确 定" otherButtonTitles:nil] show]; 176 | /*! VC 用 BAKit_ShowAlertWithMsg */ 177 | #define BAKit_ShowAlertWithMsg_ios8(msg) UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"温馨提示" message:msg preferredStyle:UIAlertControllerStyleAlert];\ 178 | UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确 定" style:UIAlertActionStyleDefault handler:nil];\ 179 | [alert addAction:sureAction];\ 180 | [self presentViewController:alert animated:YES completion:nil]; 181 | 182 | #pragma mark - color 183 | CG_INLINE UIColor * 184 | BAKit_Color_RGBA_pod(u_char r,u_char g, u_char b, u_char a) { 185 | return [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]; 186 | } 187 | 188 | CG_INLINE UIColor * 189 | BAKit_Color_RGB_pod(u_char r,u_char g, u_char b) { 190 | return BAKit_Color_RGBA_pod(r, g, b, 1.0); 191 | } 192 | 193 | CG_INLINE UIColor * 194 | BAKit_Color_RGBValue_pod(UInt32 rgbValue){ 195 | return [UIColor colorWithRed:((rgbValue & 0xff0000) >> 16) / 255.0f 196 | green:((rgbValue & 0xff00) >> 8) / 255.0f 197 | blue:(rgbValue & 0xff) / 255.0f 198 | alpha:1.0f]; 199 | } 200 | 201 | CG_INLINE UIColor * 202 | BAKit_Color_RGBAValue_pod(UInt32 rgbaValue){ 203 | return [UIColor colorWithRed:((rgbaValue & 0xff000000) >> 24) / 255.0f 204 | green:((rgbaValue & 0xff0000) >> 16) / 255.0f 205 | blue:((rgbaValue & 0xff00) >> 8) / 255.0f 206 | alpha:(rgbaValue & 0xff) / 255.0f]; 207 | } 208 | 209 | CG_INLINE UIColor * 210 | BAKit_Color_RandomRGB_pod(){ 211 | return BAKit_Color_RGBValue_pod(arc4random_uniform(0xffffff)); 212 | } 213 | 214 | CG_INLINE UIColor * 215 | BAKit_Color_RandomRGBA_pod(){ 216 | return BAKit_Color_RGBAValue_pod(arc4random_uniform(0xffffffff)); 217 | } 218 | 219 | 220 | #define BAKit_Color_Translucent_pod [UIColor colorWithRed:0.3f green:0.3f blue:0.3f alpha:0.5f] 221 | #define BAKit_Color_White_pod [UIColor whiteColor] 222 | #define BAKit_Color_Clear_pod [UIColor clearColor] 223 | #define BAKit_Color_Black_pod [UIColor blackColor] 224 | #define BAKit_Color_White_pod [UIColor whiteColor] 225 | #define BAKit_Color_Red_pod [UIColor redColor] 226 | #define BAKit_Color_Green_pod [UIColor greenColor] 227 | #define BAKit_Color_Orange_pod [UIColor orangeColor] 228 | #define BAKit_Color_Yellow_pod [UIColor yellowColor] 229 | 230 | 231 | /*! 灰色 */ 232 | #define BAKit_Color_Gray_1_pod BAKit_Color_RGB_pod(53, 60, 70) 233 | #define BAKit_Color_Gray_2_pod BAKit_Color_RGB_pod(73, 80, 90) 234 | #define BAKit_Color_Gray_3_pod BAKit_Color_RGB_pod(93, 100, 110) 235 | #define BAKit_Color_Gray_4_pod BAKit_Color_RGB_pod(113, 120, 130) 236 | #define BAKit_Color_Gray_5_pod BAKit_Color_RGB_pod(133, 140, 150) 237 | #define BAKit_Color_Gray_6_pod BAKit_Color_RGB_pod(153, 160, 170) 238 | #define BAKit_Color_Gray_7_pod BAKit_Color_RGB_pod(173, 180, 190) 239 | #define BAKit_Color_Gray_8_pod BAKit_Color_RGB_pod(196, 200, 208) 240 | #define BAKit_Color_Gray_9_pod BAKit_Color_RGB_pod(216, 220, 228) 241 | #define BAKit_Color_Gray_10_pod BAKit_Color_RGB_pod(240, 240, 240) 242 | #define BAKit_Color_Gray_11_pod BAKit_Color_RGB_pod(248, 248, 248) 243 | 244 | #pragma mark - Margin 245 | #define BAKit_Margin_1_pod BAKit_Flat_pod(1) 246 | #define BAKit_Margin_2_pod BAKit_Flat_pod(2) 247 | #define BAKit_Margin_5_pod BAKit_Flat_pod(5) 248 | #define BAKit_Margin_10_pod BAKit_Flat_pod(10) 249 | #define BAKit_Margin_15_pod BAKit_Flat_pod(15) 250 | #define BAKit_Margin_20_pod BAKit_Flat_pod(20) 251 | #define BAKit_Margin_25_pod BAKit_Flat_pod(25) 252 | #define BAKit_Margin_30_pod BAKit_Flat_pod(30) 253 | #define BAKit_Margin_35_pod BAKit_Flat_pod(35) 254 | #define BAKit_Margin_40_pod BAKit_Flat_pod(40) 255 | #define BAKit_Margin_44_pod BAKit_Flat_pod(44) 256 | #define BAKit_Margin_50_pod BAKit_Flat_pod(50) 257 | #define BAKit_Margin_100_pod BAKit_Flat_pod(100) 258 | #define BAKit_Margin_150_pod BAKit_Flat_pod(150) 259 | 260 | 261 | #define BAKit_ImageName(imageName) [UIImage imageNamed:imageName] 262 | 263 | #pragma mark - NotiCenter other 264 | #define BAKit_NotiCenter [NSNotificationCenter defaultCenter] 265 | 266 | #define BAKit_NSUserDefaults [NSUserDefaults standardUserDefaults] 267 | 268 | /*! 获取sharedApplication */ 269 | #define BAKit_SharedApplication [UIApplication sharedApplication] 270 | 271 | /*! 用safari打开URL */ 272 | #define BAKit_OpenUrl(urlStr) [BAKit_SharedApplication openURL:[NSURL URLWithString:urlStr]] 273 | 274 | /*! 复制文字内容 */ 275 | #define BAKit_CopyContent(content) [[UIPasteboard generalPasteboard] setString:content] 276 | 277 | 278 | /*! 279 | * 获取屏幕宽度和高度 280 | */ 281 | #define BAKit_SCREEN_WIDTH ((([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) || ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown)) ? [[UIScreen mainScreen] bounds].size.width : [[UIScreen mainScreen] bounds].size.height) 282 | 283 | #define BAKit_SCREEN_HEIGHT ((([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) || ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown)) ? [[UIScreen mainScreen] bounds].size.height : [[UIScreen mainScreen] bounds].size.width) 284 | 285 | #define BAKit_BaseScreenWidth 320.0f 286 | #define BAKit_BaseScreenHeight 568.0f 287 | 288 | /*! 屏幕适配(5S标准屏幕:320 * 568) */ 289 | // iPhone 7 屏幕:375 * 667 290 | //376/320 = 291 | //667/568 = 292 | #define BAKit_ScaleXAndWidth BAKit_SCREEN_WIDTH/BAKit_BaseScreenWidth 293 | #define BAKit_ScaleYAndHeight BAKit_SCREEN_HEIGHT/BAKit_BaseScreenHeight 294 | 295 | #define BAKit_ScreenScale ([[UIScreen mainScreen] scale]) 296 | 297 | CG_INLINE BOOL 298 | BAKit_stringIsBlank_pod(NSString *string) { 299 | NSCharacterSet *blank = [NSCharacterSet whitespaceAndNewlineCharacterSet]; 300 | for (NSInteger i = 0; i < string.length; ++i) { 301 | unichar c = [string characterAtIndex:i]; 302 | if (![blank characterIsMember:c]) { 303 | return NO; 304 | } 305 | } 306 | return YES; 307 | } 308 | 309 | /** 310 | * 基于指定的倍数,对传进来的 floatValue 进行像素取整。若指定倍数为0,则表示以当前设备的屏幕倍数为准。 311 | * 312 | * 例如传进来 “2.1”,在 2x 倍数下会返回 2.5(0.5pt 对应 1px),在 3x 倍数下会返回 2.333(0.333pt 对应 1px)。 313 | */ 314 | CG_INLINE CGFloat 315 | BAKit_FlatSpecificScale_pod(CGFloat floatValue, CGFloat scale) { 316 | scale = scale == 0 ? BAKit_ScreenScale : scale; 317 | CGFloat flattedValue = ceil(floatValue * scale) / scale; 318 | return flattedValue; 319 | } 320 | 321 | /** 322 | * 基于当前设备的屏幕倍数,对传进来的 floatValue 进行像素取整。 323 | * 324 | * 注意如果在 Core Graphic 绘图里使用时,要注意当前画布的倍数是否和设备屏幕倍数一致,若不一致,不可使用 flat() 函数,而应该用 flatSpecificScale 325 | */ 326 | CG_INLINE CGFloat 327 | BAKit_Flat_pod(CGFloat floatValue) { 328 | return BAKit_FlatSpecificScale_pod(floatValue, 0); 329 | } 330 | 331 | /// 将一个CGSize像素对齐 332 | CG_INLINE CGSize 333 | BAKit_CGSizeFlatted_pod(CGSize size) { 334 | return CGSizeMake(BAKit_Flat_pod(size.width), BAKit_Flat_pod(size.height)); 335 | } 336 | 337 | /// 创建一个像素对齐的CGRect 338 | CG_INLINE CGRect 339 | BAKit_CGRectFlatMake_pod(CGFloat x, CGFloat y, CGFloat width, CGFloat height) { 340 | return CGRectMake(BAKit_Flat_pod(x), BAKit_Flat_pod(y), BAKit_Flat_pod(width), BAKit_Flat_pod(height)); 341 | } 342 | 343 | /** 344 | 计算列数【根据 array.count、每行多少个 item,计算列数】 345 | 346 | @param array array 347 | @param rowCount 每行多少个 item 348 | @return 列数 349 | */ 350 | CG_INLINE NSInteger 351 | BAKit_getColumnCountWithArrayAndRowCount_pod(NSArray *array, NSInteger rowCount){ 352 | NSUInteger count = array.count; 353 | 354 | NSUInteger i = 0; 355 | if (count % rowCount == 0) 356 | { 357 | i = count / rowCount; 358 | } 359 | else 360 | { 361 | i = count / rowCount + 1; 362 | } 363 | return i; 364 | } 365 | 366 | 367 | #endif /* BAKit_ConfigurationDefine_h */ 368 | -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/CALayer+BAAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // CALayer+BAAnimation.h 3 | // BAQMUIDemo 4 | // 5 | // Created by boai on 2017/5/28. 6 | // Copyright © 2017年 boaihome. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CALayer (BAAnimation) 12 | 13 | /** 14 | 摇晃动画:用于错误提示 15 | 16 | @param value 晃动的幅度,默认:5.0f 17 | @param repeatCount 晃动的次数,默认:5.0f 18 | */ 19 | - (void)ba_layer_animationShakeWithValue:(CGFloat)value repeatCount:(CGFloat)repeatCount; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/CALayer+BAAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // CALayer+BAAnimation.m 3 | // BAQMUIDemo 4 | // 5 | // Created by boai on 2017/5/28. 6 | // Copyright © 2017年 boaihome. All rights reserved. 7 | // 8 | 9 | #import "CALayer+BAAnimation.h" 10 | 11 | static NSString * const kAnimationKey_shake = @"kAnimationKey_shake"; 12 | 13 | @implementation CALayer (BAAnimation) 14 | 15 | /** 16 | 摇晃动画:用于错误提示 17 | 18 | @param value 晃动的幅度,默认:5.0f 19 | @param repeatCount 晃动的次数,默认:5.0f 20 | */ 21 | - (void)ba_layer_animationShakeWithValue:(CGFloat)value repeatCount:(CGFloat)repeatCount 22 | { 23 | if (!value) 24 | { 25 | value = 5.0f; 26 | } 27 | if (!repeatCount) 28 | { 29 | repeatCount = 4.0f; 30 | } 31 | // 创建关键帧动画类 32 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 33 | // CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.x"]; 34 | 35 | // 设置每个关键帧的值对象的数组 36 | animation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeTranslation(-value, 0.0f, 0.0f)], [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0.0f, 0.0f, 0.0f)], [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(value, 0.0f, 0.0f)]]; 37 | // animation.values = @[@(-value),@(0),@(value),@(0),@(-value),@(0),@(value),@(0)]; 38 | 39 | // 设置是否自动翻转 40 | animation.autoreverses = YES; 41 | // 设置重复次数 42 | animation.repeatCount = repeatCount; 43 | // 设置间隔时间 44 | animation.duration = 0.08f; 45 | // 添加动画 46 | [self addAnimation:animation forKey:kAnimationKey_shake]; 47 | } 48 | 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/NSBundle+BAPod.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+BAPod.h 3 | // BAAlert_Example 4 | // 5 | // Created by 孙博岩 on 2018/11/15. 6 | // Copyright © 2018 boai. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NSBundle (BAPod) 14 | 15 | /** 16 | 获取文件所在name,默认情况下podName和bundlename相同,传一个即可 17 | 18 | @param bundleName bundle名字,就是在resource_bundles里面的名字 19 | @param podName pod的名字 20 | @return bundle 21 | */ 22 | + (NSBundle *)ba_bundleWithBundleName:(NSString *)bundleName 23 | podName:(NSString *)podName; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/NSBundle+BAPod.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+BAPod.m 3 | // BAAlert_Example 4 | // 5 | // Created by 孙博岩 on 2018/11/15. 6 | // Copyright © 2018 boai. All rights reserved. 7 | // 8 | 9 | #import "NSBundle+BAPod.h" 10 | 11 | @implementation NSBundle (BAPod) 12 | 13 | /** 14 | 获取文件所在name,默认情况下podName和bundlename相同,传一个即可 15 | 16 | @param bundleName bundle名字,就是在resource_bundles里面的名字 17 | @param podName pod的名字 18 | @return bundle 19 | */ 20 | + (NSBundle *)ba_bundleWithBundleName:(NSString *)bundleName 21 | podName:(NSString *)podName 22 | { 23 | if (bundleName == nil && podName == nil) { 24 | @throw @"bundleName和podName不能同时为空"; 25 | }else if (bundleName == nil ) { 26 | bundleName = podName; 27 | }else if (podName == nil) { 28 | podName = bundleName; 29 | } 30 | 31 | if ([bundleName containsString:@".bundle"]) { 32 | bundleName = [bundleName componentsSeparatedByString:@".bundle"].firstObject; 33 | } 34 | //没使用framwork的情况下 35 | NSURL *associateBundleURL = [[NSBundle mainBundle] URLForResource:bundleName withExtension:@"bundle"]; 36 | //使用framework形式 37 | if (!associateBundleURL) { 38 | associateBundleURL = [[NSBundle mainBundle] URLForResource:@"Frameworks" withExtension:nil]; 39 | associateBundleURL = [associateBundleURL URLByAppendingPathComponent:podName]; 40 | associateBundleURL = [associateBundleURL URLByAppendingPathExtension:@"framework"]; 41 | NSBundle *associateBunle = [NSBundle bundleWithURL:associateBundleURL]; 42 | associateBundleURL = [associateBunle URLForResource:bundleName withExtension:@"bundle"]; 43 | } 44 | 45 | NSAssert(associateBundleURL, @"取不到关联bundle"); 46 | //生产环境直接返回空 47 | return associateBundleURL?[NSBundle bundleWithURL:associateBundleURL]:nil; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /BAAlert/Classes/BAAlert/UIView+BAAnimation.h: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * @header BAKit.h 4 | * 5 | * @brief BAKit 6 | * 7 | * @author 博爱 8 | * @copyright Copyright © 2016年 博爱. All rights reserved. 9 | * @version V1.0 10 | */ 11 | 12 | // _ooOoo_ 13 | // o8888888o 14 | // 88" . "88 15 | // (| -_- |) 16 | // O\ = /O 17 | // ____/`---'\____ 18 | // . ' \\| |// `. 19 | // / \\||| : |||// \ 20 | // / _||||| -:- |||||- \ 21 | // | | \\\ - /// | | 22 | // | \_| ''\---/'' | | 23 | // \ .-\__ `-` ___/-. / 24 | // ___`. .' /--.--\ `. . __ 25 | // ."" '< `.___\_<|>_/___.' >'"". 26 | // | | : `- \`.;`\ _ /`;.`/ - ` : | | 27 | // \ \ `-. \_ __\ /__ _/ .-` / / 28 | // ======`-.____`-.___\_____/___.-`____.-'====== 29 | // `=---=' 30 | // 31 | // ............................................. 32 | // 佛祖镇楼 BUG辟易 33 | // 佛曰: 34 | // 写字楼里写字间,写字间里程序员; 35 | // 程序人员写程序,又拿程序换酒钱。 36 | // 酒醒只在网上坐,酒醉还来网下眠; 37 | // 酒醉酒醒日复日,网上网下年复年。 38 | // 但愿老死电脑间,不愿鞠躬老板前; 39 | // 奔驰宝马贵者趣,公交自行程序员。 40 | // 别人笑我忒疯癫,我笑自己命太贱; 41 | // 不见满街漂亮妹,哪个归得程序员? 42 | 43 | /* 44 | 45 | ********************************************************************************* 46 | * 47 | * 在使用 BAKit 的过程中如果出现 bug 请及时以以下任意一种方式联系我,我会及时修复 bug 48 | * 49 | * QQ : 可以添加ios开发技术群 479663605 在这里找到我(博爱1616【137361770】) 50 | * 微博 : 博爱1616 51 | * Email : 137361770@qq.com 52 | * GitHub : https://github.com/boai 53 | * BAHome : https://github.com/BAHome 54 | * 博客 : http://boaihome.com 55 | 56 | ********************************************************************************* 57 | 58 | */ 59 | 60 | 61 | #import 62 | #import 63 | 64 | NS_ASSUME_NONNULL_BEGIN 65 | /** 66 | view 的 进出场动画 方向 67 | 68 | - BAKit_ViewAnimationEnterDirectionTypeTop: 从 top 进入 69 | - BAKit_ViewAnimationEnterDirectionTypeLeft: 从 left 进入 70 | - BAKit_ViewAnimationEnterDirectionTypeBottom: 从 bottom 进入 71 | - BAKit_ViewAnimationEnterDirectionTypeRitht: 从 right 进入 72 | */ 73 | typedef NS_ENUM(NSUInteger, BAKit_ViewAnimationEnterDirectionType) { 74 | BAKit_ViewAnimationEnterDirectionTypeTop, 75 | BAKit_ViewAnimationEnterDirectionTypeLeft, 76 | BAKit_ViewAnimationEnterDirectionTypeBottom, 77 | BAKit_ViewAnimationEnterDirectionTypeRitht, 78 | }; 79 | 80 | /** 81 | view 的 翻动动画 方向 82 | 83 | - BAKit_ViewAnimationFlipDirectionTypeTop: 向 top 翻动 84 | - BAKit_ViewAnimationFlipDirectionTypeLeft: 向 left 翻动 85 | - BAKit_ViewAnimationFlipDirectionTypeBottom: 向 bottom 翻动 86 | - BAKit_ViewAnimationFlipDirectionTypeRight: 向 right 翻动 87 | */ 88 | typedef NS_ENUM(NSUInteger, BAKit_ViewAnimationFlipDirectionType) 89 | { 90 | BAKit_ViewAnimationFlipDirectionTypeTop = 0, 91 | BAKit_ViewAnimationFlipDirectionTypeLeft, 92 | BAKit_ViewAnimationFlipDirectionTypeBottom, 93 | BAKit_ViewAnimationFlipDirectionTypeRight, 94 | }; 95 | 96 | /** 97 | * Direction of the translation 98 | */ 99 | typedef NS_ENUM(NSInteger, UIViewAnimationTranslationDirection) 100 | { 101 | /** 102 | * Translation from left to right 103 | */ 104 | UIViewAnimationTranslationDirectionFromLeftToRight = 0, 105 | /** 106 | * Translation from right to left 107 | */ 108 | UIViewAnimationTranslationDirectionFromRightToLeft 109 | }; 110 | 111 | /** 112 | * Direction of the linear gradient 113 | */ 114 | typedef NS_ENUM(NSInteger, UIViewLinearGradientDirection) 115 | { 116 | /** 117 | * Linear gradient vertical 118 | */ 119 | UIViewLinearGradientDirectionVertical = 0, 120 | /** 121 | * Linear gradient horizontal 122 | */ 123 | UIViewLinearGradientDirectionHorizontal, 124 | /** 125 | * Linear gradient from left to right and top to down 126 | */ 127 | UIViewLinearGradientDirectionDiagonalFromLeftToRightAndTopToDown, 128 | /** 129 | * Linear gradient from left to right and down to top 130 | */ 131 | UIViewLinearGradientDirectionDiagonalFromLeftToRightAndDownToTop, 132 | /** 133 | * Linear gradient from right to left and top to down 134 | */ 135 | UIViewLinearGradientDirectionDiagonalFromRightToLeftAndTopToDown, 136 | /** 137 | * Linear gradient from right to left and down to top 138 | */ 139 | UIViewLinearGradientDirectionDiagonalFromRightToLeftAndDownToTop 140 | }; 141 | 142 | 143 | @interface UIView (BAAnimation) 144 | 145 | /*! 146 | * 缩放显示动画 147 | * 148 | * @param duration 持续时间,默认:1.0f 149 | * @param scaleRatio 缩放比率,默认:1.6f 150 | * @param finishBlock 缩放完成回调 151 | */ 152 | - (void)ba_animation_scaleShowWithDuration:(CGFloat)duration 153 | ratio:(CGFloat)scaleRatio 154 | finishBlock:(void(^)())finishBlock; 155 | 156 | /*! 157 | * 缩放消失动画 158 | * 159 | * @param duration 持续时间,默认:1.0f 160 | * @param scaleRatio 缩放比率,默认:1.6f 161 | * @param finishBlock 缩放完成回调 162 | */ 163 | - (void)ba_animation_scaleDismissWithDuration:(CGFloat)duration 164 | ratio:(CGFloat)scaleRatio 165 | finishBlock:(void(^)())finishBlock; 166 | 167 | /*! 168 | * 透明度动画 169 | * 170 | * @param duration 持续时间,默认:1.5f 171 | * @param startAlpha 开始的 alpha,默认:0.2f 172 | * @param finishAlpha 结束的 alpha,默认:1.0f 173 | */ 174 | - (void)ba_animation_alphaWithDuration:(CGFloat)duration 175 | startAlpha:(CGFloat)startAlpha 176 | finishAlpha:(CGFloat)finishAlpha; 177 | 178 | /*! 179 | * 转场动画 180 | * 181 | * @param duration 持续时间,默认:1.5f 182 | * @param startOptions 开始转场动画样式 183 | * @param finishOptions 结束转场动画样式 184 | * @param finishBlock 转场结束回调 185 | */ 186 | - (void)ba_animation_transitionWithDuration:(CGFloat)duration 187 | startOptions:(UIViewAnimationOptions)startOptions 188 | finishOptions:(UIViewAnimationOptions)finishOptions 189 | finishBlock:(void(^)())finishBlock; 190 | 191 | /*! 192 | * 改变 frame 动画 193 | * 194 | * @param duration 持续时间,默认:1.5f 195 | * @param originalFrame 原始 frame 196 | * @param newFrame 更改后的 frame 197 | * @param finishBlock 结束回调 198 | */ 199 | - (void)ba_animation_changFrameWithDuration:(CGFloat)duration 200 | originalFrame:(CGRect)originalFrame 201 | newFrame:(CGRect)newFrame 202 | finishBlock:(void(^)())finishBlock; 203 | 204 | /*! 205 | * 改变 Bounds 动画 206 | * 207 | * @param duration 持续时间,默认:1.5f 208 | * @param originalBounds 原始 Bounds 209 | * @param newBounds 更改后的 Bounds 210 | * @param finishBlock 结束回调 211 | */ 212 | - (void)ba_animation_changBoundsWithDuration:(CGFloat)duration 213 | originalBounds:(CGRect)originalBounds 214 | newBounds:(CGRect)newBounds 215 | finishBlock:(void(^)())finishBlock; 216 | 217 | /*! 218 | * 改变 Center 动画 219 | * 220 | * @param duration 持续时间,默认:1.5f 221 | * @param originalCenter 原始 Center 222 | * @param newCenter 更改后的 Center 223 | * @param finishBlock 结束回调 224 | */ 225 | - (void)ba_animation_changCenterWithDuration:(CGFloat)duration 226 | originalCenter:(CGPoint)originalCenter 227 | newCenter:(CGPoint)newCenter 228 | finishBlock:(void(^)())finishBlock; 229 | 230 | /** 231 | 弹簧动画 232 | 233 | @param duration 持续时间,默认:1.5f 234 | @param delay delay 235 | @param damping 震动效果,范围 0~1,数值越小震动效果越明显 236 | @param initialSpringVelocity 初始速度,数值越大初始速度越快,默认:1.0f 237 | @param startOptions 动画的过渡效果 238 | @param finishOptions 动画的过渡效果 239 | @param startBlock 开始动画回调 240 | @param finishBlock 结束动画回调 241 | */ 242 | - (void)ba_animation_springWithDuration:(CGFloat)duration 243 | delay:(CGFloat)delay 244 | damping:(CGFloat)damping 245 | initialSpringVelocity:(CGFloat)initialSpringVelocity 246 | startOptions:(UIViewAnimationOptions)startOptions 247 | finishOptions:(UIViewAnimationOptions)finishOptions 248 | startBlock:(void(^)())startBlock 249 | finishBlock:(void(^)())finishBlock; 250 | 251 | /** 252 | view 出现动画 253 | 254 | @param positionType 位置类型 255 | @param duration duration 默认:1.0f 256 | @param finishBlock finishBlock 257 | */ 258 | - (void)ba_animation_showFromPositionType:(BAKit_ViewAnimationEnterDirectionType)positionType 259 | duration:(CGFloat)duration 260 | finishBlock:(void(^)())finishBlock; 261 | 262 | /** 263 | view 消失动画 264 | 265 | @param positionType 位置类型 266 | @param duration duration 默认:1.0f 267 | @param finishBlock finishBlock 268 | */ 269 | - (void)ba_animation_dismissFromPositionType:(BAKit_ViewAnimationEnterDirectionType)positionType 270 | duration:(CGFloat)duration 271 | finishBlock:(void(^)())finishBlock; 272 | 273 | /** 274 | view 翻转动画 275 | 276 | @param duration 位置类型 277 | @param direction duration 默认:1.0f 278 | */ 279 | - (void)ba_animation_flipWithDuration:(NSTimeInterval)duration 280 | direction:(BAKit_ViewAnimationFlipDirectionType)direction; 281 | 282 | - (void)ba_animation_translateAroundTheView:(UIView *)topView 283 | duration:(CGFloat)duration 284 | direction:(UIViewAnimationTranslationDirection)direction 285 | repeat:(BOOL)repeat 286 | startFromEdge:(BOOL)startFromEdge; 287 | 288 | /** 289 | 线性梯度:渐变色,注意:渐变颜色必须要有两个及两个以上颜色,否则设置无效! 290 | 291 | @param colorArray 颜色数组,至少两个 292 | @param frame frame 293 | @param direction 方向,横向还是纵向 294 | */ 295 | - (void)ba_animation_createGradientWithColorArray:(NSArray *)colorArray 296 | frame:(CGRect)frame 297 | direction:(UIViewLinearGradientDirection)direction; 298 | 299 | /** 300 | * 摇晃动画:用于错误提示,晃动的幅度,默认:5.0f,晃动的次数,默认:5.0f 301 | */ 302 | - (void)ba_animation_viewAnimationShake; 303 | 304 | /** 305 | 脉冲动画 306 | 307 | @param duration duration 308 | */ 309 | - (void)ba_animation_pulseViewWithDuration:(CGFloat)duration; 310 | 311 | /** 312 | 运动效果 313 | */ 314 | - (void)ba_animation_applyMotionEffects; 315 | 316 | /** 317 | UIView:简单的 alpha 动画 318 | 319 | @param alpha alpha description 320 | @param duration duration description 321 | @param animated animated description 322 | */ 323 | - (void)ba_animationWithAlpha:(CGFloat)alpha 324 | duration:(NSTimeInterval)duration 325 | animated:(BOOL)animated; 326 | @end 327 | NS_ASSUME_NONNULL_END 328 | 329 | -------------------------------------------------------------------------------- /BAAlert/Resources/BAAlert.bundle/arow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/BAAlert/Resources/BAAlert.bundle/arow_down.png -------------------------------------------------------------------------------- /BAAlert/Resources/BAAlert.bundle/arow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/BAAlert/Resources/BAAlert.bundle/arow_right.png -------------------------------------------------------------------------------- /BAAlert/Resources/BAAlert.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /BAAlert/Resources/BAAlert.xcassets/arow_down.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "arow_down@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "arow_down@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /BAAlert/Resources/BAAlert.xcassets/arow_down.imageset/arow_down@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/BAAlert/Resources/BAAlert.xcassets/arow_down.imageset/arow_down@2x.png -------------------------------------------------------------------------------- /BAAlert/Resources/BAAlert.xcassets/arow_down.imageset/arow_down@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/BAAlert/Resources/BAAlert.xcassets/arow_down.imageset/arow_down@3x.png -------------------------------------------------------------------------------- /BAAlert/Resources/BAAlert.xcassets/arow_right.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "arow_right@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "arow_right@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /BAAlert/Resources/BAAlert.xcassets/arow_right.imageset/arow_right@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/BAAlert/Resources/BAAlert.xcassets/arow_right.imageset/arow_right@2x.png -------------------------------------------------------------------------------- /BAAlert/Resources/BAAlert.xcassets/arow_right.imageset/arow_right@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/BAAlert/Resources/BAAlert.xcassets/arow_right.imageset/arow_right@3x.png -------------------------------------------------------------------------------- /Example/BAAlert.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 11 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 12 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 13 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 14 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 15 | 6003F59E195388D20070C39A /* BAAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* BAAppDelegate.m */; }; 16 | 6003F5A7195388D20070C39A /* BAViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* BAViewController.m */; }; 17 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 18 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; 19 | 9CAF1DB6219C25CC00D859BE /* ViewController2.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CAF1DB3219C25CC00D859BE /* ViewController2.m */; }; 20 | 9CAF1DB7219C25CC00D859BE /* CustomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CAF1DB4219C25CC00D859BE /* CustomView.m */; }; 21 | 9CAF1DB9219C262800D859BE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9CAF1DB8219C262800D859BE /* Main.storyboard */; }; 22 | B39DC16E7E89600788F5916D /* Pods_BAAlert_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D115CC6605B99B95997F0E45 /* Pods_BAAlert_Example.framework */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 1C52753CFDDAAAD7F92C4549 /* Pods_BAAlert_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BAAlert_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 27 | 2581BB3925E7236A97078E96 /* Pods-BAAlert_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BAAlert_Example.release.xcconfig"; path = "Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example.release.xcconfig"; sourceTree = ""; }; 28 | 2C8423B251656DF450C017C0 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 29 | 3E2AF1890C9579ED20154E3B /* Pods-BAAlert_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BAAlert_Tests.debug.xcconfig"; path = "Target Support Files/Pods-BAAlert_Tests/Pods-BAAlert_Tests.debug.xcconfig"; sourceTree = ""; }; 30 | 4D8011EF6FE07890A28D71F6 /* Pods-BAAlert_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BAAlert_Example.debug.xcconfig"; path = "Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example.debug.xcconfig"; sourceTree = ""; }; 31 | 6003F58A195388D20070C39A /* BAAlert_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BAAlert_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 33 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 34 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 35 | 6003F595195388D20070C39A /* BAAlert-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BAAlert-Info.plist"; sourceTree = ""; }; 36 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 37 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 38 | 6003F59B195388D20070C39A /* BAAlert-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BAAlert-Prefix.pch"; sourceTree = ""; }; 39 | 6003F59C195388D20070C39A /* BAAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BAAppDelegate.h; sourceTree = ""; }; 40 | 6003F59D195388D20070C39A /* BAAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BAAppDelegate.m; sourceTree = ""; }; 41 | 6003F5A5195388D20070C39A /* BAViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BAViewController.h; sourceTree = ""; }; 42 | 6003F5A6195388D20070C39A /* BAViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BAViewController.m; sourceTree = ""; }; 43 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 44 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 45 | 6AC1F32E5AC187AD1AAA4257 /* Pods-BAAlert_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BAAlert_Tests.release.xcconfig"; path = "Target Support Files/Pods-BAAlert_Tests/Pods-BAAlert_Tests.release.xcconfig"; sourceTree = ""; }; 46 | 6CFBF2D0B990AD141A4F3150 /* BAAlert.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = BAAlert.podspec; path = ../BAAlert.podspec; sourceTree = ""; }; 47 | 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | 9199F1AA863122710CE90B05 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 49 | 9CAF1DB2219C25CC00D859BE /* CustomView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomView.h; sourceTree = ""; }; 50 | 9CAF1DB3219C25CC00D859BE /* ViewController2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController2.m; sourceTree = ""; }; 51 | 9CAF1DB4219C25CC00D859BE /* CustomView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomView.m; sourceTree = ""; }; 52 | 9CAF1DB5219C25CC00D859BE /* ViewController2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController2.h; sourceTree = ""; }; 53 | 9CAF1DB8219C262800D859BE /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 54 | D115CC6605B99B95997F0E45 /* Pods_BAAlert_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BAAlert_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | /* End PBXFileReference section */ 56 | 57 | /* Begin PBXFrameworksBuildPhase section */ 58 | 6003F587195388D20070C39A /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 63 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 64 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 65 | B39DC16E7E89600788F5916D /* Pods_BAAlert_Example.framework in Frameworks */, 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | /* End PBXFrameworksBuildPhase section */ 70 | 71 | /* Begin PBXGroup section */ 72 | 44FC50D28757B391B41E027C /* Pods */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 4D8011EF6FE07890A28D71F6 /* Pods-BAAlert_Example.debug.xcconfig */, 76 | 2581BB3925E7236A97078E96 /* Pods-BAAlert_Example.release.xcconfig */, 77 | 3E2AF1890C9579ED20154E3B /* Pods-BAAlert_Tests.debug.xcconfig */, 78 | 6AC1F32E5AC187AD1AAA4257 /* Pods-BAAlert_Tests.release.xcconfig */, 79 | ); 80 | path = Pods; 81 | sourceTree = ""; 82 | }; 83 | 6003F581195388D10070C39A = { 84 | isa = PBXGroup; 85 | children = ( 86 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 87 | 6003F593195388D20070C39A /* Example for BAAlert */, 88 | 6003F58C195388D20070C39A /* Frameworks */, 89 | 6003F58B195388D20070C39A /* Products */, 90 | 44FC50D28757B391B41E027C /* Pods */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 6003F58B195388D20070C39A /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 6003F58A195388D20070C39A /* BAAlert_Example.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 6003F58C195388D20070C39A /* Frameworks */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 6003F58D195388D20070C39A /* Foundation.framework */, 106 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 107 | 6003F591195388D20070C39A /* UIKit.framework */, 108 | 6003F5AF195388D20070C39A /* XCTest.framework */, 109 | D115CC6605B99B95997F0E45 /* Pods_BAAlert_Example.framework */, 110 | 1C52753CFDDAAAD7F92C4549 /* Pods_BAAlert_Tests.framework */, 111 | ); 112 | name = Frameworks; 113 | sourceTree = ""; 114 | }; 115 | 6003F593195388D20070C39A /* Example for BAAlert */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 6003F59C195388D20070C39A /* BAAppDelegate.h */, 119 | 6003F59D195388D20070C39A /* BAAppDelegate.m */, 120 | 6003F5A5195388D20070C39A /* BAViewController.h */, 121 | 6003F5A6195388D20070C39A /* BAViewController.m */, 122 | 9CAF1DB2219C25CC00D859BE /* CustomView.h */, 123 | 9CAF1DB4219C25CC00D859BE /* CustomView.m */, 124 | 9CAF1DB5219C25CC00D859BE /* ViewController2.h */, 125 | 9CAF1DB3219C25CC00D859BE /* ViewController2.m */, 126 | 9CAF1DB8219C262800D859BE /* Main.storyboard */, 127 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, 128 | 6003F5A8195388D20070C39A /* Images.xcassets */, 129 | 6003F594195388D20070C39A /* Supporting Files */, 130 | ); 131 | name = "Example for BAAlert"; 132 | path = BAAlert; 133 | sourceTree = ""; 134 | }; 135 | 6003F594195388D20070C39A /* Supporting Files */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 6003F595195388D20070C39A /* BAAlert-Info.plist */, 139 | 6003F596195388D20070C39A /* InfoPlist.strings */, 140 | 6003F599195388D20070C39A /* main.m */, 141 | 6003F59B195388D20070C39A /* BAAlert-Prefix.pch */, 142 | ); 143 | name = "Supporting Files"; 144 | sourceTree = ""; 145 | }; 146 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 6CFBF2D0B990AD141A4F3150 /* BAAlert.podspec */, 150 | 2C8423B251656DF450C017C0 /* README.md */, 151 | 9199F1AA863122710CE90B05 /* LICENSE */, 152 | ); 153 | name = "Podspec Metadata"; 154 | sourceTree = ""; 155 | }; 156 | /* End PBXGroup section */ 157 | 158 | /* Begin PBXNativeTarget section */ 159 | 6003F589195388D20070C39A /* BAAlert_Example */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "BAAlert_Example" */; 162 | buildPhases = ( 163 | A7DFE371689EFB607AD9C7AA /* [CP] Check Pods Manifest.lock */, 164 | 6003F586195388D20070C39A /* Sources */, 165 | 6003F587195388D20070C39A /* Frameworks */, 166 | 6003F588195388D20070C39A /* Resources */, 167 | 6105338B848B9A5DFB89D3BF /* [CP] Embed Pods Frameworks */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | ); 173 | name = BAAlert_Example; 174 | productName = BAAlert; 175 | productReference = 6003F58A195388D20070C39A /* BAAlert_Example.app */; 176 | productType = "com.apple.product-type.application"; 177 | }; 178 | /* End PBXNativeTarget section */ 179 | 180 | /* Begin PBXProject section */ 181 | 6003F582195388D10070C39A /* Project object */ = { 182 | isa = PBXProject; 183 | attributes = { 184 | CLASSPREFIX = BA; 185 | LastUpgradeCheck = 0720; 186 | ORGANIZATIONNAME = boai; 187 | TargetAttributes = { 188 | 6003F589195388D20070C39A = { 189 | DevelopmentTeam = A7FRU6ZJRL; 190 | }; 191 | }; 192 | }; 193 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "BAAlert" */; 194 | compatibilityVersion = "Xcode 3.2"; 195 | developmentRegion = English; 196 | hasScannedForEncodings = 0; 197 | knownRegions = ( 198 | en, 199 | Base, 200 | ); 201 | mainGroup = 6003F581195388D10070C39A; 202 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 203 | projectDirPath = ""; 204 | projectRoot = ""; 205 | targets = ( 206 | 6003F589195388D20070C39A /* BAAlert_Example */, 207 | ); 208 | }; 209 | /* End PBXProject section */ 210 | 211 | /* Begin PBXResourcesBuildPhase section */ 212 | 6003F588195388D20070C39A /* Resources */ = { 213 | isa = PBXResourcesBuildPhase; 214 | buildActionMask = 2147483647; 215 | files = ( 216 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, 217 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 218 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 219 | 9CAF1DB9219C262800D859BE /* Main.storyboard in Resources */, 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | }; 223 | /* End PBXResourcesBuildPhase section */ 224 | 225 | /* Begin PBXShellScriptBuildPhase section */ 226 | 6105338B848B9A5DFB89D3BF /* [CP] Embed Pods Frameworks */ = { 227 | isa = PBXShellScriptBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | ); 231 | inputFileListPaths = ( 232 | ); 233 | inputPaths = ( 234 | "${PODS_ROOT}/Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example-frameworks.sh", 235 | "${BUILT_PRODUCTS_DIR}/BAAlert/BAAlert.framework", 236 | ); 237 | name = "[CP] Embed Pods Frameworks"; 238 | outputFileListPaths = ( 239 | ); 240 | outputPaths = ( 241 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BAAlert.framework", 242 | ); 243 | runOnlyForDeploymentPostprocessing = 0; 244 | shellPath = /bin/sh; 245 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example-frameworks.sh\"\n"; 246 | showEnvVarsInLog = 0; 247 | }; 248 | A7DFE371689EFB607AD9C7AA /* [CP] Check Pods Manifest.lock */ = { 249 | isa = PBXShellScriptBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | ); 253 | inputFileListPaths = ( 254 | ); 255 | inputPaths = ( 256 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 257 | "${PODS_ROOT}/Manifest.lock", 258 | ); 259 | name = "[CP] Check Pods Manifest.lock"; 260 | outputFileListPaths = ( 261 | ); 262 | outputPaths = ( 263 | "$(DERIVED_FILE_DIR)/Pods-BAAlert_Example-checkManifestLockResult.txt", 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | shellPath = /bin/sh; 267 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 268 | showEnvVarsInLog = 0; 269 | }; 270 | /* End PBXShellScriptBuildPhase section */ 271 | 272 | /* Begin PBXSourcesBuildPhase section */ 273 | 6003F586195388D20070C39A /* Sources */ = { 274 | isa = PBXSourcesBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | 9CAF1DB7219C25CC00D859BE /* CustomView.m in Sources */, 278 | 6003F59E195388D20070C39A /* BAAppDelegate.m in Sources */, 279 | 9CAF1DB6219C25CC00D859BE /* ViewController2.m in Sources */, 280 | 6003F5A7195388D20070C39A /* BAViewController.m in Sources */, 281 | 6003F59A195388D20070C39A /* main.m in Sources */, 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | /* End PBXSourcesBuildPhase section */ 286 | 287 | /* Begin PBXVariantGroup section */ 288 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 289 | isa = PBXVariantGroup; 290 | children = ( 291 | 6003F597195388D20070C39A /* en */, 292 | ); 293 | name = InfoPlist.strings; 294 | sourceTree = ""; 295 | }; 296 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = { 297 | isa = PBXVariantGroup; 298 | children = ( 299 | 71719F9E1E33DC2100824A3D /* Base */, 300 | ); 301 | name = LaunchScreen.storyboard; 302 | sourceTree = ""; 303 | }; 304 | /* End PBXVariantGroup section */ 305 | 306 | /* Begin XCBuildConfiguration section */ 307 | 6003F5BD195388D20070C39A /* Debug */ = { 308 | isa = XCBuildConfiguration; 309 | buildSettings = { 310 | ALWAYS_SEARCH_USER_PATHS = NO; 311 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 312 | CLANG_CXX_LIBRARY = "libc++"; 313 | CLANG_ENABLE_MODULES = YES; 314 | CLANG_ENABLE_OBJC_ARC = YES; 315 | CLANG_WARN_BOOL_CONVERSION = YES; 316 | CLANG_WARN_CONSTANT_CONVERSION = YES; 317 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 318 | CLANG_WARN_EMPTY_BODY = YES; 319 | CLANG_WARN_ENUM_CONVERSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 322 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 323 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 324 | COPY_PHASE_STRIP = NO; 325 | ENABLE_TESTABILITY = YES; 326 | GCC_C_LANGUAGE_STANDARD = gnu99; 327 | GCC_DYNAMIC_NO_PIC = NO; 328 | GCC_OPTIMIZATION_LEVEL = 0; 329 | GCC_PREPROCESSOR_DEFINITIONS = ( 330 | "DEBUG=1", 331 | "$(inherited)", 332 | ); 333 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 334 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 335 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 336 | GCC_WARN_UNDECLARED_SELECTOR = YES; 337 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 338 | GCC_WARN_UNUSED_FUNCTION = YES; 339 | GCC_WARN_UNUSED_VARIABLE = YES; 340 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 341 | ONLY_ACTIVE_ARCH = YES; 342 | SDKROOT = iphoneos; 343 | TARGETED_DEVICE_FAMILY = "1,2"; 344 | }; 345 | name = Debug; 346 | }; 347 | 6003F5BE195388D20070C39A /* Release */ = { 348 | isa = XCBuildConfiguration; 349 | buildSettings = { 350 | ALWAYS_SEARCH_USER_PATHS = NO; 351 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 352 | CLANG_CXX_LIBRARY = "libc++"; 353 | CLANG_ENABLE_MODULES = YES; 354 | CLANG_ENABLE_OBJC_ARC = YES; 355 | CLANG_WARN_BOOL_CONVERSION = YES; 356 | CLANG_WARN_CONSTANT_CONVERSION = YES; 357 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 358 | CLANG_WARN_EMPTY_BODY = YES; 359 | CLANG_WARN_ENUM_CONVERSION = YES; 360 | CLANG_WARN_INT_CONVERSION = YES; 361 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 362 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 363 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 364 | COPY_PHASE_STRIP = YES; 365 | ENABLE_NS_ASSERTIONS = NO; 366 | GCC_C_LANGUAGE_STANDARD = gnu99; 367 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 368 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 369 | GCC_WARN_UNDECLARED_SELECTOR = YES; 370 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 371 | GCC_WARN_UNUSED_FUNCTION = YES; 372 | GCC_WARN_UNUSED_VARIABLE = YES; 373 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 374 | SDKROOT = iphoneos; 375 | TARGETED_DEVICE_FAMILY = "1,2"; 376 | VALIDATE_PRODUCT = YES; 377 | }; 378 | name = Release; 379 | }; 380 | 6003F5C0195388D20070C39A /* Debug */ = { 381 | isa = XCBuildConfiguration; 382 | baseConfigurationReference = 4D8011EF6FE07890A28D71F6 /* Pods-BAAlert_Example.debug.xcconfig */; 383 | buildSettings = { 384 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 385 | DEVELOPMENT_TEAM = A7FRU6ZJRL; 386 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 387 | GCC_PREFIX_HEADER = "BAAlert/BAAlert-Prefix.pch"; 388 | INFOPLIST_FILE = "BAAlert/BAAlert-Info.plist"; 389 | MODULE_NAME = ExampleApp; 390 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 391 | PRODUCT_NAME = "$(TARGET_NAME)"; 392 | WRAPPER_EXTENSION = app; 393 | }; 394 | name = Debug; 395 | }; 396 | 6003F5C1195388D20070C39A /* Release */ = { 397 | isa = XCBuildConfiguration; 398 | baseConfigurationReference = 2581BB3925E7236A97078E96 /* Pods-BAAlert_Example.release.xcconfig */; 399 | buildSettings = { 400 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 401 | DEVELOPMENT_TEAM = A7FRU6ZJRL; 402 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 403 | GCC_PREFIX_HEADER = "BAAlert/BAAlert-Prefix.pch"; 404 | INFOPLIST_FILE = "BAAlert/BAAlert-Info.plist"; 405 | MODULE_NAME = ExampleApp; 406 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 407 | PRODUCT_NAME = "$(TARGET_NAME)"; 408 | WRAPPER_EXTENSION = app; 409 | }; 410 | name = Release; 411 | }; 412 | /* End XCBuildConfiguration section */ 413 | 414 | /* Begin XCConfigurationList section */ 415 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "BAAlert" */ = { 416 | isa = XCConfigurationList; 417 | buildConfigurations = ( 418 | 6003F5BD195388D20070C39A /* Debug */, 419 | 6003F5BE195388D20070C39A /* Release */, 420 | ); 421 | defaultConfigurationIsVisible = 0; 422 | defaultConfigurationName = Release; 423 | }; 424 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "BAAlert_Example" */ = { 425 | isa = XCConfigurationList; 426 | buildConfigurations = ( 427 | 6003F5C0195388D20070C39A /* Debug */, 428 | 6003F5C1195388D20070C39A /* Release */, 429 | ); 430 | defaultConfigurationIsVisible = 0; 431 | defaultConfigurationName = Release; 432 | }; 433 | /* End XCConfigurationList section */ 434 | }; 435 | rootObject = 6003F582195388D10070C39A /* Project object */; 436 | } 437 | -------------------------------------------------------------------------------- /Example/BAAlert.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/BAAlert.xcodeproj/xcshareddata/xcschemes/BAAlert-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Example/BAAlert.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/BAAlert.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/BAAlert.xcworkspace/xcuserdata/sunboyan.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/Example/BAAlert.xcworkspace/xcuserdata/sunboyan.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example/BAAlert.xcworkspace/xcuserdata/sunboyan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 40 | 52 | 53 | 54 | 56 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Example/BAAlert/BAAlert-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/BAAlert/BAAlert-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/BAAlert/BAAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // BAAppDelegate.h 3 | // BAAlert 4 | // 5 | // Created by boai on 11/14/2018. 6 | // Copyright (c) 2018 boai. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface BAAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/BAAlert/BAAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // BAAppDelegate.m 3 | // BAAlert 4 | // 5 | // Created by boai on 11/14/2018. 6 | // Copyright (c) 2018 boai. All rights reserved. 7 | // 8 | 9 | #import "BAAppDelegate.h" 10 | 11 | @implementation BAAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/BAAlert/BAViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BAViewController.h 3 | // BAAlert 4 | // 5 | // Created by boai on 11/14/2018. 6 | // Copyright (c) 2018 boai. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface BAViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/BAAlert/BAViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BAViewController.m 3 | // BAAlert 4 | // 5 | // Created by boai on 11/14/2018. 6 | // Copyright (c) 2018 boai. All rights reserved. 7 | // 8 | 9 | #import "BAViewController.h" 10 | 11 | #import "ViewController2.h" 12 | #import "CustomView.h" 13 | 14 | #import 15 | 16 | 17 | static NSString * const title0 = @"温馨提示"; 18 | static NSString * const titleMsg0 = @"欢迎使用 iPhone SE,迄今最高性能的 4 英寸 iPhone。在打造这款手机时,我们在深得人心的 4 英寸设计基础上,从里到外重新构想。它所采用的 A9 芯片,正是在 iPhone 6s 上使用的先进芯片。1200 万像素的摄像头能拍出令人叹为观止的精彩照片和 4K 视频,而 Live Photos 则会让你的照片栩栩如生。这一切,成就了一款外形小巧却异常强大的 iPhone。\n对于 MacBook,我们给自己设定了一个几乎不可能实现的目标:在有史以来最为轻盈纤薄的 Mac 笔记本电脑上,打造全尺寸的使用体验。这就要求每个元素都必须重新构想,不仅令其更为纤薄轻巧,还要更加出色。最终我们带来的,不仅是一部新款的笔记本电脑,更是一种对笔记本电脑的前瞻性思考。现在,有了第六代 Intel 处理器、提升的图形处理性能、高速闪存和最长可达 10 小时的电池使用时间*,MacBook 的强大更进一步。\n欢迎使用 iPhone SE,迄今最高性能的 4 英寸 iPhone。在打造这款手机时,我们在深得人心的 4 英寸设计基础上,从里到外重新构想。它所采用的 A9 芯片,正是在 iPhone 6s 上使用的先进芯片。1200 万像素的摄像头能拍出令人叹为观止的精彩照片和 4K 视频,而 Live Photos 则会让你的照片栩栩如生。这一切,成就了一款外形小巧却异常强大的 iPhone。\n对于 MacBook,我们给自己设定了一个几乎不可能实现的目标:在有史以来最为轻盈纤薄的 Mac 笔记本电脑上,打造全尺寸的使用体验。这就要求每个元素都必须重新构想,不仅令其更为纤薄轻巧,还要更加出色。最终我们带来的,不仅是一部新款的笔记本电脑,更是一种对笔记本电脑的前瞻性思考。现在,有了第六代 Intel 处理器、提升的图形处理性能、高速闪存和最长可达 10 小时的电池使用时间*,MacBook 的强大更进一步。"; 19 | 20 | static NSString * const titleMsg1 = @"欢迎使用 iPhone SE,迄今最高性能的 4 英寸 iPhone。在打造这款手机时,我们在深得人心的 4 英寸设计基础上,从里到外重新构想。它所采用的 A9 芯片,正是在 iPhone 6s 上使用的先进芯片。1200 万像素的摄像头能拍出令人叹为观止的精彩照片和 4K 视频,而 Live Photos 则会让你的照片栩栩如生。这一切,成就了一款外形小巧却异常强大的 iPhone。"; 21 | static NSString * const titleMsg2 = @"对于 MacBook,我们给自己设定了一个几乎不可能实现的目标:在有史以来最为轻盈纤薄的 Mac 笔记本电脑上,打造全尺寸的使用体验。这就要求每个元素都必须重新构想,不仅令其更为纤薄轻巧,还要更加出色。最终我们带来的,不仅是一部新款的笔记本电脑,更是一种对笔记本电脑的前瞻性思考。现在,有了第六代 Intel 处理器、提升的图形处理性能、高速闪存和最长可达 10 小时的电池使用时间*,MacBook 的强大更进一步。"; 22 | 23 | @interface BAViewController () 24 | 25 | @property (nonatomic, strong) UITableView *tableView; 26 | 27 | @property (nonatomic, strong) BAAlert *alertView1; 28 | @property (nonatomic, strong) BAAlert *alertView2; 29 | @property (nonatomic, strong) BAAlert *alertView3; 30 | @property (nonatomic, strong) BAAlert *alertView4; 31 | @property (nonatomic, strong) BAAlert *alertView5; 32 | 33 | @property (nonatomic, strong) BAActionSheet *actionSheet; 34 | 35 | @property(nonatomic, strong) CustomView *customView; 36 | 37 | @property (strong, nonatomic) NSArray *dataArray; 38 | 39 | @end 40 | 41 | @implementation BAViewController 42 | 43 | 44 | - (void)viewDidLoad 45 | { 46 | [super viewDidLoad]; 47 | 48 | self.tableView.estimatedRowHeight = 44.f; 49 | self.tableView.rowHeight = UITableViewAutomaticDimension; 50 | 51 | self.title = @"BAAlert-OC"; 52 | } 53 | 54 | #pragma mark - UITableViewDataSource / UITableViewDelegate 55 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 56 | { 57 | return self.dataArray.count; 58 | } 59 | 60 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 61 | { 62 | return [self.dataArray[section] count]; 63 | } 64 | 65 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 66 | { 67 | static NSString *identifier = @"cell"; 68 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; 69 | 70 | if ( !cell ) 71 | { 72 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; 73 | cell.textLabel.numberOfLines = 0; 74 | 75 | cell.accessoryType = 0 == indexPath.section?UITableViewCellAccessoryDisclosureIndicator:UITableViewCellAccessoryNone; 76 | cell.selectionStyle = 0 == indexPath.section?UITableViewCellSelectionStyleDefault:UITableViewCellSelectionStyleNone; 77 | } 78 | NSArray *tempArray = self.dataArray[indexPath.section]; 79 | cell.textLabel.text = tempArray[indexPath.row]; 80 | 81 | return cell; 82 | } 83 | 84 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 85 | { 86 | if ( 0 == indexPath.section ) 87 | { 88 | [self showAlertAction:indexPath.row + 1]; 89 | } 90 | else if ( 1 == indexPath.section ) 91 | { 92 | switch ( indexPath.row ) { 93 | case 0: 94 | { 95 | [self actionSheet1]; 96 | } 97 | break; 98 | case 1: 99 | { 100 | [self actionSheet2]; 101 | } 102 | break; 103 | case 2: 104 | { 105 | [self actionSheet3]; 106 | } 107 | break; 108 | default: 109 | break; 110 | } 111 | } 112 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 113 | } 114 | 115 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 116 | { 117 | UIView *headerView = [UIView new]; 118 | 119 | UILabel *headerTitle = [UILabel new]; 120 | headerTitle.font = [UIFont systemFontOfSize:14]; 121 | headerTitle.textColor = [UIColor redColor]; 122 | headerTitle.numberOfLines = 0; 123 | [headerView addSubview:headerTitle]; 124 | 125 | headerTitle.frame = CGRectMake(20, 0, BAKit_SCREEN_WIDTH - 40, 40); 126 | 127 | if (0 == section) 128 | { 129 | headerTitle.text = @"BAAlert 的几种日常用法,高斯模糊、炫酷动画,应有尽有!"; 130 | } 131 | else if (1 == section) 132 | { 133 | headerTitle.text = @"BAActionSheet"; 134 | } 135 | else if (2 == section) 136 | { 137 | headerTitle.text = @"BAAlert特点"; 138 | } 139 | 140 | return headerView; 141 | } 142 | 143 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 144 | { 145 | return 40; 146 | } 147 | 148 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section 149 | { 150 | return FLT_MIN; 151 | } 152 | 153 | #pragma mark - 点击事件 154 | - (void)showAlertAction:(NSInteger)index 155 | { 156 | switch (index) { 157 | case 1: 158 | [self performSelector:@selector(alert1)]; 159 | break; 160 | case 2: 161 | [self performSelector:@selector(alert2)]; 162 | break; 163 | case 3: 164 | [self performSelector:@selector(alert3)]; 165 | break; 166 | case 4: 167 | [self performSelector:@selector(alert4)]; 168 | break; 169 | case 5: 170 | [self performSelector:@selector(alert5)]; 171 | break; 172 | 173 | default: 174 | break; 175 | } 176 | } 177 | 178 | - (void)actionSheet1 179 | { 180 | NSMutableArray *dataArray = [NSMutableArray array]; 181 | NSArray *contentArray = @[@"微信支付", @"支付宝", @"预付款账户"]; 182 | NSArray *subContentArray = @[@"", @"18588888888", @"余额:¥480.00"]; 183 | NSArray *imageArray = @[@"123.png", @"背景.jpg", @"美女.jpg"]; 184 | 185 | for (NSInteger i = 0; i < contentArray.count; i++) 186 | { 187 | BAActionSheetModel *model = [BAActionSheetModel new]; 188 | model.imageUrl = imageArray[i]; 189 | model.content = contentArray[i]; 190 | model.subContent = subContentArray[i]; 191 | 192 | [dataArray addObject:model]; 193 | } 194 | BAKit_WeakSelf 195 | [BAActionSheet ba_actionSheetShowWithConfiguration:^(BAActionSheet *tempView) { 196 | 197 | BAKit_StrongSelf 198 | tempView.title = @"支付方式"; 199 | tempView.dataArray = dataArray; 200 | tempView.isTouchEdgeHide = NO; 201 | tempView.showAnimate = YES; 202 | 203 | self.actionSheet = tempView; 204 | } actionBlock:^(NSIndexPath *indexPath, BAActionSheetModel *model) { 205 | BAKit_ShowAlertWithMsg_ios8(model.content); 206 | }]; 207 | } 208 | 209 | - (void)actionSheet2 210 | { 211 | NSMutableArray *dataArray = [NSMutableArray array]; 212 | NSArray *contentArray = @[@"微信支付", @"支付宝", @"预付款账户"]; 213 | 214 | for (NSInteger i = 0; i < contentArray.count; i++) 215 | { 216 | BAActionSheetModel *model = [BAActionSheetModel new]; 217 | // model.imageUrl = imageArray[i]; 218 | model.content = contentArray[i]; 219 | // model.subContent = subContentArray[i]; 220 | 221 | [dataArray addObject:model]; 222 | } 223 | BAKit_WeakSelf 224 | [BAActionSheet ba_actionSheetShowWithConfiguration:^(BAActionSheet *tempView) { 225 | 226 | BAKit_StrongSelf 227 | // tempView.title = @"支付方式"; 228 | tempView.dataArray = dataArray; 229 | tempView.actionSheetType = BAActionSheetTypeCustom; 230 | // tempView.isTouchEdgeHide = NO; 231 | 232 | self.actionSheet = tempView; 233 | } actionBlock:^(NSIndexPath *indexPath, BAActionSheetModel *model) { 234 | BAKit_ShowAlertWithMsg_ios8(model.content); 235 | }]; 236 | } 237 | 238 | - (void)actionSheet3 239 | { 240 | NSArray *contentArray = @[@"微信支付", @"支付宝", @"预付款账户", @"中行"]; 241 | NSArray *subContentArray = @[ 242 | @[@"微信支付1", @"微信支付2", @"微信支付3"], 243 | @[@"支付宝1", @"支付宝2", @"支付宝3", @"支付宝4"], 244 | @[], 245 | @[@"中行1", @"中行2", @"中行3", @"中行4", @"中行5", @"中行6", @"中行7", @"中行2", @"中行3", @"中行4", @"中行5", @"中行6", @"中行7", @"中行2", @"中行3", @"中行4", @"中行5", @"中行6", @"中行7", @"中行2", @"中行3", @"中行4", @"中行5", @"中行6", @"中行7"] 246 | ]; 247 | 248 | NSMutableArray *dataArray = @[].mutableCopy; 249 | for (NSInteger i = 0; i < contentArray.count; i++) 250 | { 251 | BAActionSheetModel *model = [BAActionSheetModel new]; 252 | model.content = contentArray[i]; 253 | 254 | NSMutableArray *mutArray = @[].mutableCopy; 255 | for (NSInteger j = 0; j < subContentArray[i].count; j ++) 256 | { 257 | BAActionSheetSubContentModel *subContentModel = [BAActionSheetSubContentModel new]; 258 | subContentModel.subContent = subContentArray[i][j]; 259 | [mutArray addObject:subContentModel]; 260 | } 261 | model.subContentArray = mutArray; 262 | 263 | [dataArray addObject:model]; 264 | } 265 | 266 | BAKit_WeakSelf 267 | [BAActionSheet ba_actionSheetShowWithConfiguration:^(BAActionSheet *tempView) { 268 | 269 | BAKit_StrongSelf 270 | tempView.title = @"支付方式"; 271 | tempView.dataArray = dataArray; 272 | tempView.actionSheetType = BAActionSheetTypeExpand; 273 | // tempView.isTouchEdgeHide = NO; 274 | 275 | self.actionSheet = tempView; 276 | } actionBlock:^(NSIndexPath *indexPath, BAActionSheetModel *model) { 277 | if (model.subContentArray.count > 0) 278 | { 279 | BAKit_ShowAlertWithMsg_ios8(model.subContentArray[indexPath.row].subContent); 280 | } 281 | else 282 | { 283 | BAKit_ShowAlertWithMsg_ios8(model.content); 284 | } 285 | }]; 286 | } 287 | 288 | 289 | - (void)alert1 290 | { 291 | BAKit_WeakSelf 292 | /*! 第一种封装使用示例 */ 293 | [BAAlert ba_alertShowWithTitle:title0 message:titleMsg0 image:nil buttonTitleArray:@[@"取消",@"确定",@"确定2",@"确定3"] buttonTitleColorArray:@[[UIColor greenColor], [UIColor redColor], [UIColor grayColor], [UIColor purpleColor]] configuration:^(BAAlert *tempView) { 294 | BAKit_StrongSelf 295 | // temp.bgColor = [UIColor colorWithRed:0 green:1.0 blue:0 alpha:0.3]; 296 | /*! 开启边缘触摸隐藏alertView */ 297 | tempView.isTouchEdgeHide = YES; 298 | /*! 添加高斯模糊的样式 */ 299 | tempView.blurEffectStyle = BAAlertBlurEffectStyleLight; 300 | /*! 开启动画 */ 301 | tempView.showAnimate = YES; 302 | // /*! 进出场动画样式 默认为:1 */ 303 | // tempView.animatingStyle = 1; 304 | self.alertView1 = tempView; 305 | } actionBlock:^(BAAlert *tempView,NSInteger index) { 306 | BAKit_StrongSelf 307 | [self.alertView1 ba_alertHidden]; 308 | if (index == 1) 309 | { 310 | NSLog(@"点击了确定按钮!"); 311 | ViewController2 *vc2 = [ViewController2 new]; 312 | vc2.title = @"alert1"; 313 | [self.navigationController pushViewController:vc2 animated:YES]; 314 | } 315 | }]; 316 | } 317 | 318 | - (void)alert2 319 | { 320 | // /*! 2、自定义按钮颜色 */ 321 | BAKit_WeakSelf 322 | [BAAlert ba_alertShowWithTitle:@"温馨提示:" message:titleMsg2 image:nil buttonTitleArray:@[@"取消", @"跳转VC2"] buttonTitleColorArray:@[[UIColor greenColor], [UIColor redColor]] configuration:^(BAAlert *tempView) { 323 | BAKit_StrongSelf 324 | /*! 自定义按钮文字颜色 */ 325 | // tempView.buttonTitleColor = [UIColor orangeColor]; 326 | tempView.bgColor = [UIColor colorWithRed:1.0 green:1.0 blue:0 alpha:0.3]; 327 | tempView.isTouchEdgeHide = YES; 328 | 329 | /*! 是否开启进出场动画 默认:NO,如果 YES ,并且同步设置进出场动画枚举为默认值:1 */ 330 | tempView.showAnimate = YES; 331 | tempView.animatingStyle = BAAlertAnimatingStyleShake; 332 | 333 | self.alertView2 = tempView; 334 | 335 | } actionBlock:^(BAAlert *tempView,NSInteger index) { 336 | BAKit_StrongSelf 337 | [self.alertView2 ba_alertHidden]; 338 | if (index == 0) 339 | { 340 | NSLog(@"点击了取消按钮!"); 341 | } 342 | else if (index == 1) 343 | { 344 | NSLog(@"点击了确定按钮!"); 345 | ViewController2 *vc2 = [ViewController2 new]; 346 | vc2.title = @"alert2"; 347 | [self.navigationController pushViewController:vc2 animated:YES]; 348 | } 349 | }]; 350 | } 351 | 352 | - (void)alert3 353 | { 354 | /*! 3、自定义背景图片 */ 355 | BAKit_WeakSelf 356 | [BAAlert ba_alertShowWithTitle:@"温馨提示:" message:titleMsg1 image:nil buttonTitleArray:@[@"取消", @"确定"] buttonTitleColorArray:@[[UIColor greenColor], [UIColor redColor]] configuration:^(BAAlert *tempView) { 357 | BAKit_StrongSelf 358 | /*! 自定义按钮文字颜色 */ 359 | // tempView.buttonTitleColor = [UIColor orangeColor]; 360 | /*! 自定义alert的背景图片 */ 361 | tempView.bgImageName = @"背景.jpg"; 362 | /*! 开启动画,并且设置动画样式,默认:1 */ 363 | // tempView.showAnimate = YES; 364 | 365 | /*! 没有开启动画,直接进出场动画样式,默认开启动画 */ 366 | tempView.animatingStyle = BAAlertAnimatingStyleFall; 367 | 368 | self.alertView3 = tempView; 369 | } actionBlock:^(BAAlert *tempView,NSInteger index) { 370 | BAKit_StrongSelf 371 | [self.alertView3 ba_alertHidden]; 372 | if (index == 0) 373 | { 374 | NSLog(@"点击了取消按钮!"); 375 | } 376 | else if (index == 1) 377 | { 378 | NSLog(@"点击了确定按钮!"); 379 | ViewController2 *vc2 = [ViewController2 new]; 380 | vc2.title = @"alert3"; 381 | [self.navigationController pushViewController:vc2 animated:YES]; 382 | } 383 | }]; 384 | } 385 | 386 | - (void)alert4 387 | { 388 | /*! 4、内置图片和文字,可滑动查看 */ 389 | BAKit_WeakSelf 390 | [BAAlert ba_alertShowWithTitle:@"温馨提示:" message:titleMsg1 image:[UIImage imageNamed:@"美女.jpg"] buttonTitleArray:@[@"取消", @"跳转VC2"] buttonTitleColorArray:@[[UIColor greenColor], [UIColor redColor]] configuration:^(BAAlert *tempView) { 391 | BAKit_StrongSelf 392 | /*! 自定义按钮文字颜色 */ 393 | // tempView.buttonTitleColor = [UIColor orangeColor]; 394 | /*! 自定义alert的背景图片 */ 395 | tempView.bgImageName = @"背景.jpg"; 396 | /*! 是否显示动画效果 */ 397 | tempView.showAnimate = YES; 398 | self.alertView4 = tempView; 399 | } actionBlock:^(BAAlert *tempView,NSInteger index) { 400 | BAKit_StrongSelf 401 | [self.alertView4 ba_alertHidden]; 402 | if (index == 0) 403 | { 404 | NSLog(@"点击了取消按钮!"); 405 | } 406 | else if (index == 1) 407 | { 408 | NSLog(@"点击了确定按钮!"); 409 | ViewController2 *vc2 = [ViewController2 new]; 410 | vc2.title = @"alert4"; 411 | [self.navigationController pushViewController:vc2 animated:YES]; 412 | } 413 | }]; 414 | } 415 | 416 | - (void)alert5 417 | { 418 | /*! 5、完全自定义alert,注意:此处不能使用懒加载创建自定义的 view,只能每次弹出都创建,以免第二次弹出不显示,因为 alert 在消失的时候,会将 自定义的 view 全部移除! */ 419 | _customView = [CustomView new]; 420 | self.customView.frame = CGRectMake(50, BAKit_SCREEN_HEIGHT - 200, BAKit_SCREEN_WIDTH - 50 * 2, 162); 421 | // 设置居中 422 | // self.customView.center = self.view.center; 423 | /*! 使用 BAAlert 弹出自定义View */ 424 | BAKit_WeakSelf 425 | [BAAlert ba_alertShowCustomView:self.customView configuration:^(BAAlert *tempView) { 426 | 427 | BAKit_StrongSelf 428 | tempView.isTouchEdgeHide = NO; 429 | /*! 是否需要开启键盘自适应 默认:NO,注意:如果用了第三方键盘适配的话,可以将此属性设置为 NO!以免冲突 */ 430 | tempView.isNeedAutoKeyboardFrame = YES; 431 | tempView.animatingStyle = BAAlertAnimatingStyleScale; 432 | self.alertView5 = tempView; 433 | }]; 434 | 435 | self.customView.block = ^(NSInteger index) { 436 | BAKit_StrongSelf 437 | if (index == 1) 438 | { 439 | [self.alertView5 ba_alertHidden]; 440 | } 441 | }; 442 | } 443 | 444 | - (BOOL)prefersStatusBarHidden { 445 | return false; 446 | } 447 | 448 | - (void)viewDidLayoutSubviews { 449 | [super viewDidLayoutSubviews]; 450 | 451 | self.tableView.frame = self.view.bounds; 452 | 453 | } 454 | 455 | #pragma mark - setter / getter 456 | 457 | - (UITableView *)tableView 458 | { 459 | if (!_tableView) 460 | { 461 | _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; 462 | self.tableView.delegate = self; 463 | self.tableView.dataSource = self; 464 | 465 | [self.view addSubview:self.tableView]; 466 | } 467 | return _tableView; 468 | } 469 | 470 | - (NSArray *)dataArray 471 | { 472 | if ( !_dataArray ) 473 | { 474 | _dataArray = [NSArray arrayWithObjects:@[@"1、类似系统alert【加边缘手势消失】", 475 | @"2、自定义按钮颜色", 476 | @"3、自定义背景图片", 477 | @"4、内置图片和文字,可滑动查看", 478 | @"5、完全自定义alert" 479 | ], 480 | @[@"1、actionsheet 默认样式:title、subTitle、image", 481 | @"2、actionsheet custom样式,类似于微博的 actionsheet", 482 | @"3、actionsheet 展开选择样式,可以展开收回"], 483 | @[@"1、手势触摸隐藏开关,可随时开关\n2、可以自定义背景图片、背景颜色、按钮颜色\n3、可以添加文字和图片,且可以滑动查看!\n4、横竖屏适配完美\n5、有各种炫酷动画展示你的alert\n6、可以自定义按钮颜色\n7、理论完全兼容现有所有 iOS 系统版本" 484 | ], nil]; 485 | } 486 | return _dataArray; 487 | } 488 | 489 | @end 490 | 491 | -------------------------------------------------------------------------------- /Example/BAAlert/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Example/BAAlert/CustomView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomView.h 3 | // BAAlert 4 | // 5 | // Created by boai on 2017/5/12. 6 | // Copyright © 2017年 boai. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void (^HandleButtonActionBlock)(NSInteger index); 12 | 13 | @interface CustomView : UIView 14 | 15 | @property(nonatomic, copy) HandleButtonActionBlock block; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Example/BAAlert/CustomView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomView.m 3 | // BAAlert 4 | // 5 | // Created by boai on 2017/5/12. 6 | // Copyright © 2017年 boai. All rights reserved. 7 | // 8 | 9 | #import "CustomView.h" 10 | #import 11 | 12 | @interface CustomView () 13 | 14 | @property (nonatomic, strong) UIView *viewPwdBgView; 15 | @property (nonatomic, strong) UILabel *titleLabel; 16 | @property (nonatomic, strong) UIView *lineView1; 17 | @property (nonatomic, strong) UITextField *pwdTextField; 18 | @property (nonatomic, strong) UIView *lineView2; 19 | @property (nonatomic, strong) UIButton *cancleButton; 20 | @property (nonatomic, strong) UIButton *sureButton; 21 | 22 | @property(nonatomic, strong) BAAlert *alert; 23 | 24 | @end 25 | 26 | @implementation CustomView 27 | 28 | - (instancetype)init 29 | { 30 | self = [super init]; 31 | if (self) { 32 | [self setupUI]; 33 | } 34 | return self; 35 | } 36 | 37 | - (instancetype)initWithFrame:(CGRect)frame 38 | { 39 | self = [super initWithFrame:frame]; 40 | if (self) { 41 | [self setupUI]; 42 | } 43 | return self; 44 | } 45 | 46 | - (void)setupUI 47 | { 48 | self.viewPwdBgView.backgroundColor = [UIColor whiteColor]; 49 | } 50 | 51 | - (void)layoutSubviews 52 | { 53 | [super layoutSubviews]; 54 | 55 | self.viewPwdBgView.frame = self.bounds; 56 | 57 | CGFloat min_x = 0; 58 | CGFloat min_y = 0; 59 | CGFloat min_w = 0; 60 | CGFloat min_h = 0; 61 | CGFloat button_h = 40; 62 | CGFloat view_w = CGRectGetWidth(self.viewPwdBgView.frame); 63 | 64 | min_w = view_w; 65 | min_h = button_h; 66 | self.titleLabel.frame = CGRectMake(min_x, min_y, min_w, min_h); 67 | 68 | min_y = CGRectGetMaxY(self.titleLabel.frame); 69 | min_h = 1; 70 | self.lineView1.frame = CGRectMake(min_x, min_y, min_w, min_h); 71 | 72 | min_x = 50; 73 | min_y = CGRectGetMaxY(self.lineView1.frame) + 20; 74 | min_w = view_w - 50 * 2; 75 | min_h = button_h; 76 | self.pwdTextField.frame = CGRectMake(min_x, min_y, min_w, min_h); 77 | 78 | min_x = 0; 79 | min_y = CGRectGetMaxY(self.pwdTextField.frame) + 20; 80 | min_w = view_w; 81 | min_h = 1; 82 | self.lineView2.frame = CGRectMake(min_x, min_y, min_w, min_h); 83 | 84 | min_y = CGRectGetMaxY(self.lineView2.frame); 85 | min_w = view_w/2; 86 | min_h = button_h; 87 | self.cancleButton.frame = CGRectMake(min_x, min_y, min_w, min_h); 88 | 89 | min_x = CGRectGetMaxX(self.cancleButton.frame); 90 | self.sureButton.frame = CGRectMake(min_x, min_y, min_w, min_h); 91 | } 92 | 93 | #pragma mark - custom method 94 | 95 | - (void)handleButtonAction:(UIButton *)sender 96 | { 97 | [_pwdTextField resignFirstResponder]; 98 | 99 | if (self.block) 100 | { 101 | self.block(sender.tag); 102 | } 103 | if (sender.tag == 1) 104 | { 105 | NSLog(@"点击了取消按钮!"); 106 | } 107 | else 108 | { 109 | if (_pwdTextField.text.length < 4 || _pwdTextField.text.length > 8 ) 110 | { 111 | self.pwdTextField.text = @""; 112 | BAKit_WeakSelf 113 | [BAAlert ba_alertShowWithTitle:@"温馨提示:" message:@"请输入正确的密码!" image:nil buttonTitleArray:@[@"确定"] buttonTitleColorArray:@[[UIColor redColor], [UIColor cyanColor]] configuration:^(BAAlert *tempView) { 114 | BAKit_StrongSelf 115 | self.alert = tempView; 116 | } actionBlock:^(BAAlert *tempView,NSInteger index) { 117 | 118 | [self.alert ba_alertHidden]; 119 | }]; 120 | } 121 | } 122 | } 123 | 124 | - (void)dealloc 125 | { 126 | [self removeFromSuperview]; 127 | } 128 | 129 | #pragma mark - setter / getter 130 | 131 | - (UIView *)viewPwdBgView 132 | { 133 | if (!_viewPwdBgView) 134 | { 135 | _viewPwdBgView = [UIView new]; 136 | 137 | _viewPwdBgView.layer.masksToBounds = YES; 138 | _viewPwdBgView.layer.cornerRadius = 10.0f; 139 | 140 | [self addSubview:self.viewPwdBgView]; 141 | } 142 | return _viewPwdBgView; 143 | } 144 | 145 | - (UILabel *)titleLabel 146 | { 147 | if (!_titleLabel) 148 | { 149 | _titleLabel = [UILabel new]; 150 | _titleLabel.textAlignment = NSTextAlignmentCenter; 151 | _titleLabel.font = [UIFont systemFontOfSize:18]; 152 | _titleLabel.text = @"请补全好友姓名,确保信息安全"; 153 | 154 | [self.viewPwdBgView addSubview:self.titleLabel]; 155 | } 156 | return _titleLabel; 157 | } 158 | 159 | - (UIView *)lineView1 160 | { 161 | if (!_lineView1) 162 | { 163 | _lineView1 = [UIView new]; 164 | _lineView1.backgroundColor = [UIColor lightGrayColor]; 165 | 166 | [self.viewPwdBgView addSubview:self.lineView1]; 167 | } 168 | return _lineView1; 169 | } 170 | 171 | - (UITextField *)pwdTextField 172 | { 173 | if (!_pwdTextField) 174 | { 175 | _pwdTextField = [UITextField new]; 176 | _pwdTextField.borderStyle = UITextBorderStyleRoundedRect; 177 | _pwdTextField.textAlignment = NSTextAlignmentCenter; 178 | _pwdTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; 179 | 180 | [self.viewPwdBgView addSubview:self.pwdTextField]; 181 | } 182 | return _pwdTextField; 183 | } 184 | 185 | - (UIView *)lineView2 186 | { 187 | if (!_lineView2) 188 | { 189 | _lineView2 = [UIView new]; 190 | _lineView2.backgroundColor = [UIColor lightGrayColor]; 191 | 192 | [self.viewPwdBgView addSubview:self.lineView2]; 193 | } 194 | return _lineView2; 195 | } 196 | 197 | - (UIButton *)cancleButton 198 | { 199 | if (!_cancleButton) 200 | { 201 | _cancleButton = [UIButton buttonWithType:UIButtonTypeCustom]; 202 | [_cancleButton setTitle:@"取消" forState:UIControlStateNormal]; 203 | [_cancleButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 204 | [_cancleButton addTarget:self action:@selector(handleButtonAction:) forControlEvents:UIControlEventTouchUpInside]; 205 | _cancleButton.backgroundColor = [UIColor greenColor]; 206 | _cancleButton.tag = 1; 207 | 208 | [self.viewPwdBgView addSubview:self.cancleButton]; 209 | } 210 | return _cancleButton; 211 | } 212 | 213 | - (UIButton *)sureButton 214 | { 215 | if (!_sureButton) 216 | { 217 | _sureButton = [UIButton buttonWithType:UIButtonTypeCustom]; 218 | [_sureButton setTitle:@"确定" forState:UIControlStateNormal]; 219 | [_sureButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 220 | [_sureButton addTarget:self action:@selector(handleButtonAction:) forControlEvents:UIControlEventTouchUpInside]; 221 | _sureButton.backgroundColor = [UIColor redColor]; 222 | _sureButton.tag = 2; 223 | 224 | [self.viewPwdBgView addSubview:self.sureButton]; 225 | } 226 | return _sureButton; 227 | } 228 | 229 | 230 | @end 231 | -------------------------------------------------------------------------------- /Example/BAAlert/Images.xcassets/123.imageset/123.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/Example/BAAlert/Images.xcassets/123.imageset/123.png -------------------------------------------------------------------------------- /Example/BAAlert/Images.xcassets/123.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "123.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/BAAlert/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Example/BAAlert/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/BAAlert/Images.xcassets/美女.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "美女.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/BAAlert/Images.xcassets/美女.imageset/美女.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/Example/BAAlert/Images.xcassets/美女.imageset/美女.jpg -------------------------------------------------------------------------------- /Example/BAAlert/Images.xcassets/背景.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "背景.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/BAAlert/Images.xcassets/背景.imageset/背景.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/Example/BAAlert/Images.xcassets/背景.imageset/背景.jpg -------------------------------------------------------------------------------- /Example/BAAlert/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example/BAAlert/ViewController2.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController2.h 3 | // DSAlertDemo 4 | // 5 | // Created by boai on 16/8/31. 6 | // Copyright © 2016年 DS-Team. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController2 : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/BAAlert/ViewController2.m: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * @brief DSAlert-OC 4 | * 5 | * @author DS-Team 6 | * @copyright Copyright © 2016年 DS-Team. All rights reserved. 7 | * @version V1.1.0 8 | */ 9 | 10 | 11 | #import "ViewController2.h" 12 | //#import 13 | 14 | @interface ViewController2 () 15 | 16 | @end 17 | 18 | @implementation ViewController2 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | // Do any additional setup after loading the view. 23 | 24 | self.view.backgroundColor = [UIColor redColor]; 25 | 26 | } 27 | 28 | - (void)didReceiveMemoryWarning { 29 | [super didReceiveMemoryWarning]; 30 | // Dispose of any resources that can be recreated. 31 | } 32 | 33 | /* 34 | #pragma mark - Navigation 35 | 36 | // In a storyboard-based application, you will often want to do a little preparation before navigation 37 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 38 | // Get the new view controller using [segue destinationViewController]. 39 | // Pass the selected object to the new view controller. 40 | } 41 | */ 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Example/BAAlert/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/BAAlert/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // BAAlert 4 | // 5 | // Created by boai on 11/14/2018. 6 | // Copyright (c) 2018 boai. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "BAAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([BAAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'BAAlert_Example' do 4 | pod 'BAAlert', :path => '../' 5 | 6 | end 7 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - BAAlert (1.2.7) 3 | 4 | DEPENDENCIES: 5 | - BAAlert (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | BAAlert: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | BAAlert: 2f1bbace38f437628e452941ee254ecc46000844 13 | 14 | PODFILE CHECKSUM: 7bde3cca0ff1c615125fc12bd503119d1c78d90d 15 | 16 | COCOAPODS: 1.6.0.beta.2 17 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/BAAlert.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "BAAlert", 3 | "version": "1.2.7", 4 | "summary": "目前为止,最为精简的 alert 和 actionSheet 封装!BAAlert 让你的弹框不再孤单!", 5 | "description": "TODO: Add long description of the pod here.", 6 | "homepage": "https://github.com/BAHome/BAAlert", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "boai": "sunboyan@outlook.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/BAHome/BAAlert.git", 16 | "tag": "1.2.7" 17 | }, 18 | "resource_bundles": { 19 | "BAAlert": [ 20 | "BAAlert/Resources/*.{xcassets,bundle}", 21 | "BAAlert/**/*.{xib,nib,json,plist}" 22 | ] 23 | }, 24 | "source_files": "BAAlert/**/*.{h,m}", 25 | "public_header_files": "BAAlert/Classes/**/*.h}", 26 | "frameworks": [ 27 | "UIKit", 28 | "Foundation" 29 | ], 30 | "platforms": { 31 | "ios": "8.0" 32 | }, 33 | "requires_arc": true 34 | } 35 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - BAAlert (1.2.7) 3 | 4 | DEPENDENCIES: 5 | - BAAlert (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | BAAlert: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | BAAlert: 2f1bbace38f437628e452941ee254ecc46000844 13 | 14 | PODFILE CHECKSUM: 7bde3cca0ff1c615125fc12bd503119d1c78d90d 15 | 16 | COCOAPODS: 1.6.0.beta.2 17 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/sunboyan.xcuserdatad/xcschemes/BAAlert-BAAlert.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/sunboyan.xcuserdatad/xcschemes/BAAlert.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/sunboyan.xcuserdatad/xcschemes/Pods-BAAlert_Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/sunboyan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | BAAlert-BAAlert.xcscheme 8 | 9 | isShown 10 | 11 | 12 | BAAlert.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Pods-BAAlert_Example.xcscheme 18 | 19 | isShown 20 | 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BAAlert/BAAlert-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.2.7 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BAAlert/BAAlert-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_BAAlert : NSObject 3 | @end 4 | @implementation PodsDummy_BAAlert 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BAAlert/BAAlert-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BAAlert/BAAlert-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "BAActionSheet.h" 14 | #import "BAActionSheetCell.h" 15 | #import "BAAlert.h" 16 | #import "BAAlert_Config.h" 17 | #import "BAAlert_OC.h" 18 | #import "BAAlert_Version.h" 19 | #import "BAKit_ConfigurationDefine.h" 20 | #import "CALayer+BAAnimation.h" 21 | #import "NSBundle+BAPod.h" 22 | #import "UIView+BAAnimation.h" 23 | 24 | FOUNDATION_EXPORT double BAAlertVersionNumber; 25 | FOUNDATION_EXPORT const unsigned char BAAlertVersionString[]; 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BAAlert/BAAlert.modulemap: -------------------------------------------------------------------------------- 1 | framework module BAAlert { 2 | umbrella header "BAAlert-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BAAlert/BAAlert.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/BAAlert 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "UIKit" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/BAAlert/ResourceBundle-BAAlert-BAAlert-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleIdentifier 8 | ${PRODUCT_BUNDLE_IDENTIFIER} 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundleName 12 | ${PRODUCT_NAME} 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.2.7 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## BAAlert 5 | 6 | Copyright (c) 2018 boai 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2018 boai <sunboyan@outlook.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | BAAlert 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_BAAlert_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_BAAlert_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | 23 | # Used as a return value for each invocation of `strip_invalid_archs` function. 24 | STRIP_BINARY_RETVAL=0 25 | 26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 29 | 30 | # Copies and strips a vendored framework 31 | install_framework() 32 | { 33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 34 | local source="${BUILT_PRODUCTS_DIR}/$1" 35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 37 | elif [ -r "$1" ]; then 38 | local source="$1" 39 | fi 40 | 41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 42 | 43 | if [ -L "${source}" ]; then 44 | echo "Symlinked..." 45 | source="$(readlink "${source}")" 46 | fi 47 | 48 | # Use filter instead of exclude so missing patterns don't throw errors. 49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 51 | 52 | local basename 53 | basename="$(basename -s .framework "$1")" 54 | binary="${destination}/${basename}.framework/${basename}" 55 | 56 | if ! [ -r "$binary" ]; then 57 | binary="${destination}/${basename}" 58 | elif [ -L "${binary}" ]; then 59 | echo "Destination binary is symlinked..." 60 | dirname="$(dirname "${binary}")" 61 | binary="${dirname}/$(readlink "${binary}")" 62 | fi 63 | 64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 66 | strip_invalid_archs "$binary" 67 | fi 68 | 69 | # Resign the code if required by the build settings to avoid unstable apps 70 | code_sign_if_enabled "${destination}/$(basename "$1")" 71 | 72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 74 | local swift_runtime_libs 75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 76 | for lib in $swift_runtime_libs; do 77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 79 | code_sign_if_enabled "${destination}/${lib}" 80 | done 81 | fi 82 | } 83 | 84 | # Copies and strips a vendored dSYM 85 | install_dsym() { 86 | local source="$1" 87 | if [ -r "$source" ]; then 88 | # Copy the dSYM into a the targets temp dir. 89 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 90 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 91 | 92 | local basename 93 | basename="$(basename -s .framework.dSYM "$source")" 94 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 95 | 96 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 97 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 98 | strip_invalid_archs "$binary" 99 | fi 100 | 101 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 102 | # Move the stripped file into its final destination. 103 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 104 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 105 | else 106 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 107 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 108 | fi 109 | fi 110 | } 111 | 112 | # Signs a framework with the provided identity 113 | code_sign_if_enabled() { 114 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 115 | # Use the current code_sign_identity 116 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 117 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 118 | 119 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 120 | code_sign_cmd="$code_sign_cmd &" 121 | fi 122 | echo "$code_sign_cmd" 123 | eval "$code_sign_cmd" 124 | fi 125 | } 126 | 127 | # Strip invalid architectures 128 | strip_invalid_archs() { 129 | binary="$1" 130 | # Get architectures for current target binary 131 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 132 | # Intersect them with the architectures we are building for 133 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 134 | # If there are no archs supported by this binary then warn the user 135 | if [[ -z "$intersected_archs" ]]; then 136 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 137 | STRIP_BINARY_RETVAL=0 138 | return 139 | fi 140 | stripped="" 141 | for arch in $binary_archs; do 142 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 143 | # Strip non-valid architectures in-place 144 | lipo -remove "$arch" -output "$binary" "$binary" 145 | stripped="$stripped $arch" 146 | fi 147 | done 148 | if [[ "$stripped" ]]; then 149 | echo "Stripped $binary of architectures:$stripped" 150 | fi 151 | STRIP_BINARY_RETVAL=1 152 | } 153 | 154 | 155 | if [[ "$CONFIGURATION" == "Debug" ]]; then 156 | install_framework "${BUILT_PRODUCTS_DIR}/BAAlert/BAAlert.framework" 157 | fi 158 | if [[ "$CONFIGURATION" == "Release" ]]; then 159 | install_framework "${BUILT_PRODUCTS_DIR}/BAAlert/BAAlert.framework" 160 | fi 161 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 162 | wait 163 | fi 164 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 12 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # resources to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 18 | 19 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 20 | > "$RESOURCES_TO_COPY" 21 | 22 | XCASSET_FILES=() 23 | 24 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 25 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 26 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 27 | 28 | case "${TARGETED_DEVICE_FAMILY:-}" in 29 | 1,2) 30 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 31 | ;; 32 | 1) 33 | TARGET_DEVICE_ARGS="--target-device iphone" 34 | ;; 35 | 2) 36 | TARGET_DEVICE_ARGS="--target-device ipad" 37 | ;; 38 | 3) 39 | TARGET_DEVICE_ARGS="--target-device tv" 40 | ;; 41 | 4) 42 | TARGET_DEVICE_ARGS="--target-device watch" 43 | ;; 44 | *) 45 | TARGET_DEVICE_ARGS="--target-device mac" 46 | ;; 47 | esac 48 | 49 | install_resource() 50 | { 51 | if [[ "$1" = /* ]] ; then 52 | RESOURCE_PATH="$1" 53 | else 54 | RESOURCE_PATH="${PODS_ROOT}/$1" 55 | fi 56 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 57 | cat << EOM 58 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 59 | EOM 60 | exit 1 61 | fi 62 | case $RESOURCE_PATH in 63 | *.storyboard) 64 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 65 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 66 | ;; 67 | *.xib) 68 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 69 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 70 | ;; 71 | *.framework) 72 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 73 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 74 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 75 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 76 | ;; 77 | *.xcdatamodel) 78 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 79 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 80 | ;; 81 | *.xcdatamodeld) 82 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 83 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 84 | ;; 85 | *.xcmappingmodel) 86 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 87 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 88 | ;; 89 | *.xcassets) 90 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 91 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 92 | ;; 93 | *) 94 | echo "$RESOURCE_PATH" || true 95 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 96 | ;; 97 | esac 98 | } 99 | if [[ "$CONFIGURATION" == "Debug" ]]; then 100 | install_resource "${PODS_CONFIGURATION_BUILD_DIR}/BAAlert/BAAlert.bundle" 101 | fi 102 | if [[ "$CONFIGURATION" == "Release" ]]; then 103 | install_resource "${PODS_CONFIGURATION_BUILD_DIR}/BAAlert/BAAlert.bundle" 104 | fi 105 | 106 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 107 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 108 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 109 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 110 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 111 | fi 112 | rm -f "$RESOURCES_TO_COPY" 113 | 114 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 115 | then 116 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 117 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 118 | while read line; do 119 | if [[ $line != "${PODS_ROOT}*" ]]; then 120 | XCASSET_FILES+=("$line") 121 | fi 122 | done <<<"$OTHER_XCASSETS" 123 | 124 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 125 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 126 | else 127 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 128 | fi 129 | fi 130 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_BAAlert_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_BAAlert_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BAAlert" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BAAlert/BAAlert.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "BAAlert" -framework "Foundation" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_BAAlert_Example { 2 | umbrella header "Pods-BAAlert_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-BAAlert_Example/Pods-BAAlert_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BAAlert" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BAAlert/BAAlert.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "BAAlert" -framework "Foundation" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Images/BAAlert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/Images/BAAlert.png -------------------------------------------------------------------------------- /Images/BAAlert1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/Images/BAAlert1.gif -------------------------------------------------------------------------------- /Images/BAAlert2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BAHome/BAAlert/8cc21cf30ddcd293bac2b1f1dda1a6386b337251/Images/BAAlert2.gif -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 boai 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BAAlert 2 | 3 | [![BAHome Team Name](https://img.shields.io/badge/Team-BAHome-brightgreen.svg?style=flat)](https://github.com/BAHome "BAHome Team") 4 | [![CI Status](https://img.shields.io/travis/boai/BAAlert.svg?style=flat)](https://travis-ci.org/boai/BAAlert) 5 | [![Version](https://img.shields.io/cocoapods/v/BAAlert.svg?style=flat)](https://cocoapods.org/pods/BAAlert) 6 | [![License](https://img.shields.io/cocoapods/l/BAAlert.svg?style=flat)](https://cocoapods.org/pods/BAAlert) 7 | [![Platform](https://img.shields.io/cocoapods/p/BAAlert.svg?style=flat)](https://cocoapods.org/pods/BAAlert) 8 | [![](https://img.shields.io/badge/微博-博爱1616-red.svg)](http://weibo.com/538298123) 9 | 10 | ## Example 11 | 12 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 13 | 14 | ## Requirements 15 | 16 | ## Installation 17 | 18 | BAAlert is available through [CocoaPods](https://cocoapods.org). To install 19 | it, simply add the following line to your Podfile: 20 | 21 | ```ruby 22 | pod 'BAAlert' 23 | ``` 24 | 25 | ## Author 26 | 27 | boai, sunboyan@outlook.com 28 | 29 | ## License 30 | 31 | BAAlert is available under the MIT license. See the LICENSE file for more info. 32 | 33 | ## 1、功能及简介 34 | * 1、手势触摸隐藏开关,可随时开关
35 | * 2、可以自定义背景图片、背景颜色、按钮颜色 36 | * 3、可以添加文字和图片,且可以滑动查看! 37 | * 4、横竖屏适配完美 38 | * 5、有各种炫酷动画展示你的 alert 39 | * 6、可以自定义每个按钮颜色 40 | 41 | ## 2、图片示例 42 | ![BAAlert1.gif](https://github.com/BAHome/BAAlert/blob/master/Images/BAAlert1.gif) 43 | ![BAAlert2.gif](https://github.com/BAHome/BAAlert/blob/master/Images/BAAlert2.gif) 44 | 45 | ## 3、安装、导入示例和源码地址 46 | * 1、pod 导入【最新版本:![](https://img.shields.io/cocoapods/v/BAAlert.svg?style=flat) ![](https://img.shields.io/cocoapods/dt/BAAlert.svg 47 | )】:
48 | `pod 'BAAlert'` ` pod 'BAAlert-Swift'`
49 | 如果发现 `pod search BAAlert` 搜索出来的不是最新版本,需要在终端执行 cd 转换文件路径命令退回到 desktop,然后执行 `pod setup` 命令更新本地spec缓存(可能需要几分钟),然后再搜索就可以了。
50 | 具体步骤: 51 | - pod setup : 初始化 52 | - pod repo update : 更新仓库 53 | - pod search BAAlert 54 | * 2、文件夹拖入:下载demo,把 BAAlert 文件夹拖入项目即可,
55 | * 3、导入头文件:
56 | ` #import "BAAlert_OC.h" `
57 | * 4、项目源码地址:
58 | OC 版 :[https://github.com/BAHome/BAAlert](https://github.com/BAHome/BAAlert)
59 | swift 版 :[https://github.com/BAHome/BAAlert-Swift](https://github.com/BAHome/BAAlert-Swift)
60 | 系统原生 UIAlertController 分类封装:[https://github.com/BAHome/BAAlertController](https://github.com/BAHome/BAAlertController) 61 | 62 | ## 4、BAAlert 的类结构及 demo 示例 63 | ![BAAlert.png](https://github.com/BAHome/BAAlert/blob/master/Images/BAAlert.png) 64 | 65 | ### BAAlert_OC.h 66 | ``` 67 | #ifndef BAAlert_OC_h 68 | #define BAAlert_OC_h 69 | 70 | #import "BAAlert.h" 71 | #import "BAActionSheet.h" 72 | #import "BAKit_ConfigurationDefine.h" 73 | #import "CALayer+BAAnimation.h" 74 | #import "UIView+BAAnimation.h" 75 | #import "NSBundle+BAPod.h" 76 | 77 | #endif /* BAAlert_OC_h */ 78 | ``` 79 | 80 | ### BAAlert.h 81 | ``` 82 | #import 83 | #import "BAAlert_Config.h" 84 | 85 | @class BAAlert; 86 | 87 | typedef void(^BAAlert_ConfigBlock)(BAAlert *tempView); 88 | 89 | @interface BAAlert : UIView 90 | 91 | /*! 背景颜色 默认:半透明*/ 92 | @property (nonatomic, strong) UIColor *bgColor; 93 | 94 | /*! 是否开启边缘触摸隐藏 alert 默认:NO */ 95 | @property (nonatomic, assign) BOOL isTouchEdgeHide; 96 | 97 | /*! 背景图片名字 默认:没有图片*/ 98 | @property (nonatomic, strong) NSString *bgImageName; 99 | 100 | /*! 是否开启进出场动画 默认:NO,如果 YES ,并且同步设置进出场动画枚举为默认值:1 */ 101 | @property (nonatomic, assign, getter=isShowAnimate) BOOL showAnimate; 102 | 103 | /*! 进出场动画枚举 默认:1 ,并且默认开启动画开关 */ 104 | @property (nonatomic, assign) BAAlertAnimatingStyle animatingStyle; 105 | 106 | /*! 背景高斯模糊枚举 默认:没有模糊效果 */ 107 | @property (nonatomic, assign) BAAlertBlurEffectStyle blurEffectStyle; 108 | 109 | /*! 是否需要开启键盘自适应 默认:NO,注意:如果用了第三方键盘适配的话,可以将此属性设置为 NO!以免冲突 */ 110 | @property(nonatomic, assign) BOOL isNeedAutoKeyboardFrame; 111 | 112 | /*! 进场动画持续时间 默认:0.5f */ 113 | @property (nonatomic, assign) double startAnimationDuration; 114 | 115 | /*! 出场动画持续时间 默认:0.5f */ 116 | @property (nonatomic, assign) double endAnimationDuration; 117 | 118 | 119 | /*! 120 | * 创建一个完全自定义的 alertView 121 | * 122 | * @param customView 自定义 View 123 | * @param configuration 属性配置:如 bgColor、buttonTitleColor、isTouchEdgeHide... 124 | */ 125 | + (void)ba_alertShowCustomView:(UIView *)customView 126 | configuration:(BAAlert_ConfigBlock) configuration; 127 | 128 | /*! 129 | * 创建一个类似于系统的alert 130 | * 131 | * @param title 标题:可空 132 | * @param message 消息内容:可空 133 | * @param image 图片:可空 134 | * @param buttonTitleArray 按钮标题:不可空 135 | * @param buttonTitleColorArray 按钮标题颜色:可空,默认蓝色 136 | * @param configuration 属性配置:如 bgColor、buttonTitleColor、isTouchEdgeHide... 137 | * @param actionBlock 按钮的点击事件处理 138 | */ 139 | + (void)ba_alertShowWithTitle:(NSString *)title 140 | message:(NSString *)message 141 | image:(UIImage *)image 142 | buttonTitleArray:(NSArray *)buttonTitleArray 143 | buttonTitleColorArray:(NSArray *)buttonTitleColorArray 144 | configuration:(BAAlert_ConfigBlock)configuration 145 | actionBlock:(BAAlert_ButtonActionBlock)actionBlock; 146 | 147 | /*! 148 | * 视图消失 149 | */ 150 | - (void)ba_alertHidden; 151 | 152 | @end 153 | ``` 154 | 155 | ### BAActionSheet.h 156 | ``` 157 | #import 158 | #import "BAAlert_Config.h" 159 | 160 | @class BAActionSheet, BAActionSheetModel; 161 | 162 | typedef void(^BAActionSheet_ConfigBlock)(BAActionSheet *tempView); 163 | typedef void (^BAActionSheet_ActionBlock)(NSIndexPath *indexPath, BAActionSheetModel *model); 164 | 165 | 166 | @interface BAActionSheet : UIView 167 | 168 | /*! 是否开启边缘触摸隐藏 alert 默认:YES */ 169 | @property (nonatomic, assign) BOOL isTouchEdgeHide; 170 | 171 | /*! 是否开启进出场动画 默认:NO,如果 YES ,并且同步设置进出场动画枚举为默认值:1 */ 172 | @property (nonatomic, assign, getter=isShowAnimate) BOOL showAnimate; 173 | 174 | /*! 进出场动画枚举 默认:1 ,并且默认开启动画开关 */ 175 | @property (nonatomic, assign) BAAlertAnimatingStyle animatingStyle; 176 | 177 | /*! BAActionSheet 类型,默认:1 */ 178 | @property (nonatomic, assign) BAActionSheetType actionSheetType; 179 | 180 | @property (nonatomic, strong) NSArray *dataArray; 181 | @property (nonatomic, strong) NSString *title; 182 | 183 | /*! 184 | * 185 | * @param configuration 属性配置:如 bgColor、buttonTitleColor、isTouchEdgeHide... 186 | * @param actionBlock block回调点击的选项 187 | */ 188 | + (void)ba_actionSheetShowWithConfiguration:(BAActionSheet_ConfigBlock)configuration 189 | actionBlock:(BAActionSheet_ActionBlock)actionBlock; 190 | 191 | /*! 192 | * 隐藏 BAActionSheet 193 | */ 194 | - (void)ba_actionSheetHidden; 195 | 196 | @end 197 | 198 | @class BAActionSheetSubContentModel; 199 | @interface BAActionSheetModel : NSObject 200 | 201 | @property(nonatomic, copy) NSString *imageUrl; 202 | @property(nonatomic, copy) NSString *content; 203 | @property(nonatomic, copy) NSString *subContent; 204 | @property(nonatomic, strong) NSArray *subContentArray; 205 | 206 | @end 207 | 208 | @interface BAActionSheetSubContentModel : NSObject 209 | 210 | @property(nonatomic, copy) NSString *subContent; 211 | 212 | @end 213 | ``` 214 | ### demo 示例 215 | ``` 216 | - (void)actionSheet1 217 | { 218 | NSMutableArray *dataArray = [NSMutableArray array]; 219 | NSArray *contentArray = @[@"微信支付", @"支付宝", @"预付款账户"]; 220 | NSArray *subContentArray = @[@"", @"18588888888", @"余额:¥480.00"]; 221 | NSArray *imageArray = @[@"123.png", @"背景.jpg", @"美女.jpg"]; 222 | 223 | for (NSInteger i = 0; i < contentArray.count; i++) 224 | { 225 | BAActionSheetModel *model = [BAActionSheetModel new]; 226 | model.imageUrl = imageArray[i]; 227 | model.content = contentArray[i]; 228 | model.subContent = subContentArray[i]; 229 | 230 | [dataArray addObject:model]; 231 | } 232 | BAKit_WeakSelf 233 | [BAActionSheet ba_actionSheetShowWithConfiguration:^(BAActionSheet *tempView) { 234 | 235 | BAKit_StrongSelf 236 | tempView.title = @"支付方式"; 237 | tempView.dataArray = dataArray; 238 | tempView.isTouchEdgeHide = NO; 239 | tempView.showAnimate = YES; 240 | 241 | self.actionSheet = tempView; 242 | } actionBlock:^(NSIndexPath *indexPath, BAActionSheetModel *model) { 243 | BAKit_ShowAlertWithMsg_ios8(model.content); 244 | }]; 245 | } 246 | 247 | - (void)actionSheet2 248 | { 249 | NSMutableArray *dataArray = [NSMutableArray array]; 250 | NSArray *contentArray = @[@"微信支付", @"支付宝", @"预付款账户"]; 251 | 252 | for (NSInteger i = 0; i < contentArray.count; i++) 253 | { 254 | BAActionSheetModel *model = [BAActionSheetModel new]; 255 | // model.imageUrl = imageArray[i]; 256 | model.content = contentArray[i]; 257 | // model.subContent = subContentArray[i]; 258 | 259 | [dataArray addObject:model]; 260 | } 261 | BAKit_WeakSelf 262 | [BAActionSheet ba_actionSheetShowWithConfiguration:^(BAActionSheet *tempView) { 263 | 264 | BAKit_StrongSelf 265 | // tempView.title = @"支付方式"; 266 | tempView.dataArray = dataArray; 267 | tempView.actionSheetType = BAActionSheetTypeCustom; 268 | // tempView.isTouchEdgeHide = NO; 269 | 270 | self.actionSheet = tempView; 271 | } actionBlock:^(NSIndexPath *indexPath, BAActionSheetModel *model) { 272 | BAKit_ShowAlertWithMsg_ios8(model.content); 273 | }]; 274 | } 275 | 276 | - (void)actionSheet3 277 | { 278 | NSArray *contentArray = @[@"微信支付", @"支付宝", @"预付款账户", @"中行"]; 279 | NSArray *subContentArray = @[ 280 | @[@"微信支付1", @"微信支付2", @"微信支付3"], 281 | @[@"支付宝1", @"支付宝2", @"支付宝3", @"支付宝4"], 282 | @[], 283 | @[@"中行1", @"中行2", @"中行3", @"中行4", @"中行5", @"中行6", @"中行7", @"中行2", @"中行3", @"中行4", @"中行5", @"中行6", @"中行7", @"中行2", @"中行3", @"中行4", @"中行5", @"中行6", @"中行7", @"中行2", @"中行3", @"中行4", @"中行5", @"中行6", @"中行7"] 284 | ]; 285 | 286 | NSMutableArray *dataArray = @[].mutableCopy; 287 | for (NSInteger i = 0; i < contentArray.count; i++) 288 | { 289 | BAActionSheetModel *model = [BAActionSheetModel new]; 290 | model.content = contentArray[i]; 291 | 292 | NSMutableArray *mutArray = @[].mutableCopy; 293 | for (NSInteger j = 0; j < subContentArray[i].count; j ++) 294 | { 295 | BAActionSheetSubContentModel *subContentModel = [BAActionSheetSubContentModel new]; 296 | subContentModel.subContent = subContentArray[i][j]; 297 | [mutArray addObject:subContentModel]; 298 | } 299 | model.subContentArray = mutArray; 300 | 301 | [dataArray addObject:model]; 302 | } 303 | 304 | BAKit_WeakSelf 305 | [BAActionSheet ba_actionSheetShowWithConfiguration:^(BAActionSheet *tempView) { 306 | 307 | BAKit_StrongSelf 308 | tempView.title = @"支付方式"; 309 | tempView.dataArray = dataArray; 310 | tempView.actionSheetType = BAActionSheetTypeExpand; 311 | // tempView.isTouchEdgeHide = NO; 312 | 313 | self.actionSheet = tempView; 314 | } actionBlock:^(NSIndexPath *indexPath, BAActionSheetModel *model) { 315 | if (model.subContentArray.count > 0) 316 | { 317 | BAKit_ShowAlertWithMsg_ios8(model.subContentArray[indexPath.row].subContent); 318 | } 319 | else 320 | { 321 | BAKit_ShowAlertWithMsg_ios8(model.content); 322 | } 323 | }]; 324 | } 325 | 326 | 327 | - (void)alert1 328 | { 329 | BAKit_WeakSelf 330 | /*! 第一种封装使用示例 */ 331 | [BAAlert ba_alertShowWithTitle:title0 message:titleMsg0 image:nil buttonTitleArray:@[@"取消",@"确定",@"确定2",@"确定3"] buttonTitleColorArray:@[[UIColor greenColor], [UIColor redColor], [UIColor grayColor], [UIColor purpleColor]] configuration:^(BAAlert *tempView) { 332 | BAKit_StrongSelf 333 | // temp.bgColor = [UIColor colorWithRed:0 green:1.0 blue:0 alpha:0.3]; 334 | /*! 开启边缘触摸隐藏alertView */ 335 | tempView.isTouchEdgeHide = YES; 336 | /*! 添加高斯模糊的样式 */ 337 | tempView.blurEffectStyle = BAAlertBlurEffectStyleLight; 338 | /*! 开启动画 */ 339 | tempView.showAnimate = YES; 340 | // /*! 进出场动画样式 默认为:1 */ 341 | // tempView.animatingStyle = 1; 342 | self.alertView1 = tempView; 343 | } actionBlock:^(NSInteger index) { 344 | BAKit_StrongSelf 345 | [self.alertView1 ba_alertHidden]; 346 | if (index == 1) 347 | { 348 | NSLog(@"点击了确定按钮!"); 349 | ViewController2 *vc2 = [ViewController2 new]; 350 | vc2.title = @"alert1"; 351 | [self.navigationController pushViewController:vc2 animated:YES]; 352 | } 353 | }]; 354 | } 355 | 356 | - (void)alert2 357 | { 358 | // /*! 2、自定义按钮颜色 */ 359 | BAKit_WeakSelf 360 | [BAAlert ba_alertShowWithTitle:@"温馨提示:" message:titleMsg2 image:nil buttonTitleArray:@[@"取消", @"跳转VC2"] buttonTitleColorArray:@[[UIColor greenColor], [UIColor redColor]] configuration:^(BAAlert *tempView) { 361 | BAKit_StrongSelf 362 | /*! 自定义按钮文字颜色 */ 363 | // tempView.buttonTitleColor = [UIColor orangeColor]; 364 | tempView.bgColor = [UIColor colorWithRed:1.0 green:1.0 blue:0 alpha:0.3]; 365 | tempView.isTouchEdgeHide = YES; 366 | 367 | /*! 是否开启进出场动画 默认:NO,如果 YES ,并且同步设置进出场动画枚举为默认值:1 */ 368 | tempView.showAnimate = YES; 369 | tempView.animatingStyle = BAAlertAnimatingStyleShake; 370 | 371 | self.alertView2 = tempView; 372 | 373 | } actionBlock:^(NSInteger index) { 374 | BAKit_StrongSelf 375 | [self.alertView2 ba_alertHidden]; 376 | if (index == 0) 377 | { 378 | NSLog(@"点击了取消按钮!"); 379 | } 380 | else if (index == 1) 381 | { 382 | NSLog(@"点击了确定按钮!"); 383 | ViewController2 *vc2 = [ViewController2 new]; 384 | vc2.title = @"alert2"; 385 | [self.navigationController pushViewController:vc2 animated:YES]; 386 | } 387 | }]; 388 | } 389 | 390 | - (void)alert3 391 | { 392 | /*! 3、自定义背景图片 */ 393 | BAKit_WeakSelf 394 | [BAAlert ba_alertShowWithTitle:@"温馨提示:" message:titleMsg1 image:nil buttonTitleArray:@[@"取消", @"确定"] buttonTitleColorArray:@[[UIColor greenColor], [UIColor redColor]] configuration:^(BAAlert *tempView) { 395 | BAKit_StrongSelf 396 | /*! 自定义按钮文字颜色 */ 397 | // tempView.buttonTitleColor = [UIColor orangeColor]; 398 | /*! 自定义alert的背景图片 */ 399 | tempView.bgImageName = @"背景.jpg"; 400 | /*! 开启动画,并且设置动画样式,默认:1 */ 401 | // tempView.showAnimate = YES; 402 | 403 | /*! 没有开启动画,直接进出场动画样式,默认开启动画 */ 404 | tempView.animatingStyle = BAAlertAnimatingStyleFall; 405 | 406 | self.alertView3 = tempView; 407 | } actionBlock:^(NSInteger index) { 408 | BAKit_StrongSelf 409 | [self.alertView3 ba_alertHidden]; 410 | if (index == 0) 411 | { 412 | NSLog(@"点击了取消按钮!"); 413 | } 414 | else if (index == 1) 415 | { 416 | NSLog(@"点击了确定按钮!"); 417 | ViewController2 *vc2 = [ViewController2 new]; 418 | vc2.title = @"alert3"; 419 | [self.navigationController pushViewController:vc2 animated:YES]; 420 | } 421 | }]; 422 | } 423 | 424 | - (void)alert4 425 | { 426 | /*! 4、内置图片和文字,可滑动查看 */ 427 | BAKit_WeakSelf 428 | [BAAlert ba_alertShowWithTitle:@"温馨提示:" message:titleMsg1 image:[UIImage imageNamed:@"美女.jpg"] buttonTitleArray:@[@"取消", @"跳转VC2"] buttonTitleColorArray:@[[UIColor greenColor], [UIColor redColor]] configuration:^(BAAlert *tempView) { 429 | BAKit_StrongSelf 430 | /*! 自定义按钮文字颜色 */ 431 | // tempView.buttonTitleColor = [UIColor orangeColor]; 432 | /*! 自定义alert的背景图片 */ 433 | tempView.bgImageName = @"背景.jpg"; 434 | /*! 是否显示动画效果 */ 435 | tempView.showAnimate = YES; 436 | self.alertView4 = tempView; 437 | } actionBlock:^(NSInteger index) { 438 | BAKit_StrongSelf 439 | [self.alertView4 ba_alertHidden]; 440 | if (index == 0) 441 | { 442 | NSLog(@"点击了取消按钮!"); 443 | } 444 | else if (index == 1) 445 | { 446 | NSLog(@"点击了确定按钮!"); 447 | ViewController2 *vc2 = [ViewController2 new]; 448 | vc2.title = @"alert4"; 449 | [self.navigationController pushViewController:vc2 animated:YES]; 450 | } 451 | }]; 452 | } 453 | 454 | - (void)alert5 455 | { 456 | /*! 5、完全自定义alert,注意:此处不能使用懒加载创建自定义的 view,只能每次弹出都创建,以免第二次弹出不显示,因为 alert 在消失的时候,会将 自定义的 view 全部移除! */ 457 | _customView = [CustomView new]; 458 | self.customView.frame = CGRectMake(50, BAKit_SCREEN_HEIGHT - 200, BAKit_SCREEN_WIDTH - 50 * 2, 162); 459 | // 设置居中 460 | // self.customView.center = self.view.center; 461 | /*! 使用 BAAlert 弹出自定义View */ 462 | BAKit_WeakSelf 463 | [BAAlert ba_alertShowCustomView:self.customView configuration:^(BAAlert *tempView) { 464 | 465 | BAKit_StrongSelf 466 | tempView.isTouchEdgeHide = NO; 467 | /*! 是否需要开启键盘自适应 默认:NO,注意:如果用了第三方键盘适配的话,可以将此属性设置为 NO!以免冲突 */ 468 | tempView.isNeedAutoKeyboardFrame = NO; 469 | tempView.animatingStyle = BAAlertAnimatingStyleScale; 470 | self.alertView5 = tempView; 471 | }]; 472 | 473 | self.customView.block = ^(NSInteger index) { 474 | BAKit_StrongSelf 475 | if (index == 1) 476 | { 477 | [self.alertView5 ba_alertHidden]; 478 | } 479 | }; 480 | } 481 | 482 | 其他示例可下载demo查看源码! 483 | ``` 484 | 485 | ## 5、更新记录:【倒叙】 486 | 欢迎使用 [【BAHome】](https://github.com/BAHome) 系列开源代码 ! 487 | 如有更多需求,请前往:[【https://github.com/BAHome】](https://github.com/BAHome) 488 | 489 | 最新更新时间:2018-11-15 【倒叙】
490 | 最新Version:【Version:1.2.7】
491 | 更新内容:
492 | 1.2.7.1、官方 pod 标准版本 demo 全新适配,支持本地调试
493 | 1.2.7.2、公开 `#import "UIView+BAAnimation.h"` 文件
494 | 495 | 最新更新时间:2018-04-12 【倒叙】
496 | 最新Version:【Version:1.2.6】
497 | 更新内容:
498 | 1.2.6.1、新增 进场动画持续时间 默认:0.5f (startAnimationDuration/endAnimationDuration)
499 | 1.2.6.2、优化部分动画封装
500 | 501 | 最新更新时间:2017-10-30 【倒叙】
502 | 最新Version:【Version:1.2.5】
503 | 更新内容:
504 | 1.2.5.1、修复 isTouchEdgeHide 属性设置为 NO 的时候,无效的bug(感谢群里 [@北京-菲菲] 同学提出的 bug!)
505 | 1.2.5.2、修复 键盘弹出的时候,点击背景隐藏 alert 的时候,键盘偶尔消失不了的bug(感谢群里 [@广州-王培] 同学提出的 bug!)
506 | 1.2.5.3、新增 isNeedAutoKeyboardFrame 属性,是否需要开启键盘自适应 默认:NO,注意:如果用了第三方键盘适配的话,可以将此属性设置为 NO!以免冲突
507 | 508 | 最新更新时间:2017-08-21 【倒叙】
509 | 最新Version:【Version:1.2.4】
510 | 更新内容:
511 | 1.2.4.1、修复 自定义背景图片不显示的问题(感谢群里 [@北京-邵峰] 同学提出的 bug!)
512 | 513 | 最新更新时间:2017-08-18 【倒叙】
514 | 最新Version:【Version:1.2.3】
515 | 更新内容:
516 | 1.2.3.1、优化自定义 alert 的布局,横竖屏可以适配了!
517 | 518 | 最新更新时间:2017-06-23 【倒叙】
519 | 最新Version:【Version:1.2.2】
520 | 更新内容:
521 | 1.2.2.1、优化部分宏定义
522 | 523 | 最新更新时间:2017-05-20 【倒叙】
524 | 最新Version:【Version:1.1.9】
525 | 更新内容:
526 | 1.1.9.1、修复动画过度白屏问题
527 | 528 | 最新更新时间:2017-05-15 【倒叙】
529 | 最新Version:【Version:1.1.8】
530 | 更新内容:
531 | 1.1.8.1、精简代码结构,删除多余或者重复代码
532 | 1.1.8.2、规范代码属性和方法命名,原有方法名和属性名有较大改动,忘见谅
533 | 1.1.8.3、重构 actionSheet,新增多种样式
534 | 535 | 最新更新时间:2017-05-13 【倒叙】
536 | 最新Version:【Version:1.1.7】
537 | 更新内容:
538 | 1.1.7.1、精简代码结构,删除多余或者重复代码
539 | 1.1.7.2、规范代码属性和方法命名,原有方法名和属性名有较大改动,忘见谅
540 | 1.1.7.3、优化部分动画
541 | 1.1.7.4、subView 布局优化
542 | 1.1.7.5、actionSheet 新增自定义文字颜色、title 字体颜色
543 | 544 | 最新更新时间:2017-05-10 【倒叙】
545 | 最新Version:【Version:1.1.5】
546 | 更新内容:
547 | 1.1.5.1、删除原有封装内部按钮点击事件中 ba_dismissAlertView 方法,此方法可在外部自由调用
548 | 549 | 最新更新时间:2017-05-09 【倒叙】
550 | 最新Version:【Version:1.1.4】
551 | 更新内容:
552 | 1.1.4.1、pod 更新xib 文件
553 | 554 | 最新更新时间:2017-05-08 【倒叙】 555 | 最新Version:【Version:1.1.0】 556 | 更新内容: 557 | 1.1.0.1、优化方法名命名规范 558 | 1.1.0.2、新增键盘内部处理 559 | 1.1.0.3、用原生 autoLayout 重构,自定义 alert 的布局再也不是问题了 560 | 1.1.0.4、优化代码结构,修复内在隐藏内存泄漏 561 | 1.1.0.5、新增 BAAlert_OC.h 文件,只需导入 BAAlert_OC.h 一个文件就可以使用 alert 和 actionSheet 了 562 | 1.1.0.6、删除了部分代码和属性,具体见源码 和 demo 563 | 564 | ## 6、bug 反馈 565 | > 1、开发中遇到 bug,希望小伙伴儿们能够及时反馈与我们 [【BAHome】](https://github.com/BAHome) 团队,我们必定会认真对待每一个问题!
566 | 567 | > 2、以后提需求和 bug 的同学,记得把 git 或者博客链接给我们,我直接超链到你们那里!希望大家积极参与测试!
568 | 569 | ## 7、BAHome 团队成员 570 | > 1、QQ 群 571 | 479663605
572 | 【注意:此群为 2 元 付费群,介意的小伙伴儿勿扰!】
573 | 574 | > 孙博岩
575 | QQ:137361770
576 | git:[https://github.com/boai](https://github.com/boai)
577 | 简书:[http://www.jianshu.com/u/95c9800fdf47](http://www.jianshu.com/u/95c9800fdf47)
578 | 微博:[![](https://img.shields.io/badge/微博-博爱1616-red.svg)](http://weibo.com/538298123)
579 | 580 | > 马景丽
581 | QQ:1253540493
582 | git:[https://github.com/MaJingli](https://github.com/MaJingli)
583 | 584 | > 陆晓峰
585 | QQ:442171865
586 | git:[https://github.com/zeR0Lu](https://github.com/zeR0Lu)
587 | 588 | > 陈集
589 | QQ:3161182978
590 | git:[https://github.com/chenjipdc](https://github.com/chenjipdc)
591 | 简书:[http://www.jianshu.com/u/90ae559fc21d](http://www.jianshu.com/u/90ae559fc21d) 592 | 593 | > 任子丰
594 | QQ:459643690
595 | git:[https://github.com/renzifeng](https://github.com/renzifeng)
596 | 597 | > 吴丰收
598 | QQ:498121294
599 | 600 | > 石少庸
601 | QQ:363605775
602 | git:[https://github.com/CrazyCoderShi](https://github.com/CrazyCoderShi)
603 | 简书:[http://www.jianshu.com/u/0726f4d689a3](http://www.jianshu.com/u/0726f4d689a3) 604 | 605 | ## 8、开发环境 和 支持版本 606 | > 开发使用 最新版本 Xcode,理论上支持 iOS 8 及以上版本,如有版本适配问题,请及时反馈!多谢合作! 607 | 608 | ## 9、感谢 609 | > 感谢 [【BAHome】](https://github.com/BAHome) 团队成员倾力合作,后期会推出一系列 常用 UI 控件的封装,大家有需求得也可以在 issue 提出,如果合理,我们会尽快推出新版本!
610 | 611 | > [【BAHome】](https://github.com/BAHome) 的发展离不开小伙伴儿的信任与推广,再次感谢各位小伙伴儿的支持! 612 | 613 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------