针对 TweetBot 风格的 UIActionSheet 的基于块的行为替代方案
创建并显示动作表
- (instancetype)initWithTitle:(NSString *)title
cancelButtonTitle:(NSString *)cancelButtonTitle
destructiveButtonTitle:(NSString *)destructiveButtonTitle
otherButtonTitles:(NSArray *)otherButtonTitles
tapBlock:(DJWActionSheetTapBlock)tapBlock
containerView:(UIView *)containerView;
- (void)showInView:(UIView *)view;
或者使用
+ (void)showInView:(UIView *)view
withTitle:(NSString *)title
cancelButtonTitle:(NSString *)cancelButtonTitle
destructiveButtonTitle:(NSString *)destructiveButtonTitle
otherButtonTitles:(NSArray *)otherButtonTitles
tapBlock:(DJWActionSheetTapBlock)tapBlock;
在指定视图中创建并显示动作表。
当用户通过点击其中一个按钮进行响应时,将执行 tapBlock。使用 tappedButtonIndex
决定要采取的操作。
如果您正在使用 Cocoapods,只需将 DJWActionSheet
添加到您的 Podfile 中。或者,将 DJWActionSheet.h
和 DJWActionSheet.m
添加到您的项目中。