diff --git a/Libraries/ActionSheetIOS/ActionSheetIOS.js b/Libraries/ActionSheetIOS/ActionSheetIOS.js index a6f5dc2342af8a..c76a1beeb94198 100644 --- a/Libraries/ActionSheetIOS/ActionSheetIOS.js +++ b/Libraries/ActionSheetIOS/ActionSheetIOS.js @@ -17,10 +17,20 @@ var invariant = require('fbjs/lib/invariant'); var processColor = require('processColor'); var ActionSheetIOS = { + /** + * Display an iOS action sheet. The `options` object must contain one or more + * of: + * + * - `options` (array of strings) - a list of button titles (required) + * - `cancelButtonIndex` (int) - index of cancel button in `options` + * - `destructiveButtonIndex` (int) - index of destructive button in `options` + * - `title` (string) - a title to show above the action sheet + * - `message` (string) - a message to show below the title + */ showActionSheetWithOptions(options: Object, callback: Function) { invariant( typeof options === 'object' && options !== null, - 'Options must a valid object' + 'Options must be a valid object' ); invariant( typeof callback === 'function', @@ -50,7 +60,7 @@ var ActionSheetIOS = { ) { invariant( typeof options === 'object' && options !== null, - 'Options must a valid object' + 'Options must be a valid object' ); invariant( typeof failureCallback === 'function', diff --git a/Libraries/ActionSheetIOS/RCTActionSheetManager.m b/Libraries/ActionSheetIOS/RCTActionSheetManager.m index 18fc8596b115b5..f1eba5c0e410a5 100644 --- a/Libraries/ActionSheetIOS/RCTActionSheetManager.m +++ b/Libraries/ActionSheetIOS/RCTActionSheetManager.m @@ -61,6 +61,7 @@ - (CGRect)sourceRectInView:(UIView *)sourceView } NSString *title = [RCTConvert NSString:options[@"title"]]; + NSString *message = [RCTConvert NSString:options[@"message"]]; NSArray *buttons = [RCTConvert NSStringArray:options[@"options"]]; NSInteger destructiveButtonIndex = options[@"destructiveButtonIndex"] ? [RCTConvert NSInteger:options[@"destructiveButtonIndex"]] : -1; NSInteger cancelButtonIndex = options[@"cancelButtonIndex"] ? [RCTConvert NSInteger:options[@"cancelButtonIndex"]] : -1; @@ -113,7 +114,7 @@ - (CGRect)sourceRectInView:(UIView *)sourceView { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title - message:nil + message:message preferredStyle:UIAlertControllerStyleActionSheet]; NSInteger index = 0;