RSActionSheet 1.0.0

RSActionSheet 1.0.0

测试经过测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最新版本2014年12月

Rick Silva 维护。



  • 作者:
  • Rick Silva

RSActionSheet 是一个简单、基于块的 UIActionSheet 包装器。

示例

RSActionSheet* sheet = [[RSActionSheet alloc] initWithTitle:@"Example"];

[sheet addDestructiveButtonWithTitle:@"Delete Document" handler:^{
   [self deleteDocument];
}];

[sheet addButtonWithTitle:@"Do Thing 1" handler:^{
   NSLog(@"Do Thing 1 button pressed");
}];

[sheet addCancelButtonWithTitle:@"Cancel" handler:^{
   NSLog(@"Cancel button pressed");
}];

[sheet showInView:self.view];

备注

默认情况下,当按钮被点击时,调用按钮处理程序。但是,可以通过设置以下属性来更改这种行为:

typedef NS_ENUM(NSUInteger, RSActionSheetButtonHandlerType) {
   RSActionSheetButtonHandlerTypeTapped,
   RSActionSheetButtonHandlerTypeWillDismiss,
   RSActionSheetButtonHandlerTypeDidDismiss
};

// Default is RSActionSheetButtonHandlerTypeTapped
@property (assign, nonatomic) RSActionSheetButtonHandlerType buttonHandlerType

最后,按钮按其添加的顺序显示 -- 首先添加的按钮是表格中的顶部按钮。

要求

创作者

Rick Silva (@rjsmsu)

许可证

RSActionSheet 根据 MIT 许可证提供。有关更多信息,请参阅 LICENSE 文件。