TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Rick Silva.
RSActionSheet is a simple, block-based UIActionSheet wrapper.
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];
By default, the button handler is called when the button is tapped, however this behavior can be changed by setting the following property:
typedef NS_ENUM(NSUInteger, RSActionSheetButtonHandlerType) {
RSActionSheetButtonHandlerTypeTapped,
RSActionSheetButtonHandlerTypeWillDismiss,
RSActionSheetButtonHandlerTypeDidDismiss
};
// Default is RSActionSheetButtonHandlerTypeTapped
@property (assign, nonatomic) RSActionSheetButtonHandlerType buttonHandlerType
Lastly, the buttons are displayed in the order in which they are added -- the first button added is the top button in the sheet.
RSActionSheet is available under the MIT license. See the LICENSE file for more info.