RSActionSheet 1.0.0

RSActionSheet 1.0.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Rick Silva.



  • By
  • Rick Silva

RSActionSheet is a simple, block-based UIActionSheet wrapper.

Example

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];

Notes

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.

Requirements

Creator

Rick Silva (@rjsmsu)

License

RSActionSheet is available under the MIT license. See the LICENSE file for more info.