SHAlertViewBlocks 1.2.1

SHAlertViewBlocks 1.2.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布上次发布2014年12月

Seivan Heidari 维护。



  • 作者
  • Seivan Heidari

此库由 SHUIKitBlocks 使用,作为许多组件的一部分,覆盖了弥补 Foundation、UIKit、CoreLocation、GameKit、MapKit 和 iOS 应用程序架构其他方面缺失的空白。

概述

一旦警报消失,这些块会自动移除,因此不需要清理 - Swizzle Free(™)

API

初始化

添加

属性

安装

pod 'SHAlertViewBlocks'

设置

将这些内容放入特定文件或项目前缀文件中

#import "UIAlertView+SHAlertViewBlocks.h"

或者

#import "SHAlertViewBlocks.h"

API

初始化

#pragma mark -
#pragma mark Init
+(instancetype)SH_alertViewWithTitle:(NSString *)theTitle withMessage:(NSString *)theMessage;

+(instancetype)SH_alertViewWithTitle:(NSString *)theTitle
                          andMessage:(NSString *)theMessage
                        buttonTitles:(NSArray *)theButtonTitles
                         cancelTitle:(NSString *)theCancelTitle
                           withBlock:(SHAlertViewBlock)theBlock;

添加

#pragma mark -
#pragma mark Adding
-(NSInteger)SH_addButtonWithTitle:(NSString *)theTitle
                         withBlock:(SHAlertViewBlock)theBlock;


///Will add a new cancel button and make previous cancel buttons to a normal button
-(NSInteger)SH_addButtonCancelWithTitle:(NSString *)theTitle
                               withBlock:(SHAlertViewBlock)theBlock;


属性

#pragma mark -
#pragma mark Properties

#pragma mark -
#pragma mark Setters
-(void)SH_setButtonBlockForIndex:(NSInteger)theButtonIndex
                       withBlock:(SHAlertViewBlock)theBlock;

-(void)SH_setButtonCancelBlock:(SHAlertViewBlock)theBlock;

-(void)SH_setWillShowBlock:(SHAlertViewShowBlock)theBlock;
-(void)SH_setDidShowBlock:(SHAlertViewShowBlock)theBlock;

-(void)SH_setWillDismissBlock:(SHAlertViewDismissBlock)theBlock;
-(void)SH_setDidDismissBlock:(SHAlertViewDismissBlock)theBlock;

-(void)SH_setFirstButtonEnabledBlock:(SHAlertViewFirstButtonEnabledBlock)theBlock;

#pragma mark -
#pragma mark Getters
-(SHAlertViewBlock)SH_blockForButtonIndex:(NSInteger)theButtonIndex;


@property(nonatomic,readonly) SHAlertViewBlock SH_blockForCancelButton;


@property(nonatomic,readonly) SHAlertViewShowBlock    SH_blockWillShow;
@property(nonatomic,readonly) SHAlertViewShowBlock    SH_blockDidShow;

@property(nonatomic,readonly) SHAlertViewDismissBlock SH_blockWillDismiss;
@property(nonatomic,readonly) SHAlertViewDismissBlock SH_blockDidDismiss;

@property(nonatomic,readonly) SHAlertViewFirstButtonEnabledBlock SH_blockForFirstButtonEnabled;

联系

如果您在项目中使用了 SHAlertViewBlocks,我很愿意听听。

电子邮件:[email protected]
推特:@seivanheidari

许可证

SHAlertViewBlocks 是 © 2013 Seivan,可以在 MIT 许可证下免费分发。查看 LICENSE.md 文件。