From b140609304c4cc37b1fd04064bc786e1612b4874 Mon Sep 17 00:00:00 2001 From: Lane Rettig Date: Sun, 27 Mar 2016 11:45:52 -0400 Subject: [PATCH 1/3] add support for message to UIAlertController --- Libraries/ActionSheetIOS/RCTActionSheetManager.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; From 0663da5f34ded6025896c0ef008f9c542c920fe7 Mon Sep 17 00:00:00 2001 From: Lane Rettig Date: Sun, 27 Mar 2016 12:31:28 -0400 Subject: [PATCH 2/3] improve ActionSheetIOS docs --- Libraries/ActionSheetIOS/ActionSheetIOS.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Libraries/ActionSheetIOS/ActionSheetIOS.js b/Libraries/ActionSheetIOS/ActionSheetIOS.js index a6f5dc2342af8a..c995fcb39f4693 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', From 5237baae0b2ea0c85464621d34a81ccec772f505 Mon Sep 17 00:00:00 2001 From: Lane Rettig Date: Sun, 27 Mar 2016 12:47:13 -0400 Subject: [PATCH 3/3] Fix typo --- Libraries/ActionSheetIOS/ActionSheetIOS.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/ActionSheetIOS/ActionSheetIOS.js b/Libraries/ActionSheetIOS/ActionSheetIOS.js index c995fcb39f4693..c76a1beeb94198 100644 --- a/Libraries/ActionSheetIOS/ActionSheetIOS.js +++ b/Libraries/ActionSheetIOS/ActionSheetIOS.js @@ -26,7 +26,7 @@ var ActionSheetIOS = { * - `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,