From 19b65248169dc2a7ce923fb55b0d1afa0254581f Mon Sep 17 00:00:00 2001 From: Rob Hudson Date: Mon, 27 Apr 2015 16:08:51 -0400 Subject: [PATCH] Add optional delegate methods to README. --- README.md | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index c2d7f31..3559a4d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ IBActionSheet ========= -[![Pod Version](https://img.shields.io/cocoapods/v/IBActionSheet.svg?style=flat)](http://cocoadocs.org/docsets/IBActionSheet/) -[![Pod Platform](https://img.shields.io/cocoapods/p/IBActionSheet.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) +[![Pod Version](https://img.shields.io/cocoapods/v/IBActionSheet.svg?style=flat)](http://cocoadocs.org/docsets/IBActionSheet/) +[![Pod Platform](https://img.shields.io/cocoapods/p/IBActionSheet.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) [![Pod License](https://img.shields.io/cocoapods/l/IBActionSheet.svg?style=flat)](http://cocoadocs.org/docsets/IBActionSheet) Fully customizable iOS 7/8 style UIActionSheet replacement. Compatible with iOS 5, 6, 7, and 8. @@ -9,7 +9,7 @@ Fully customizable iOS 7/8 style UIActionSheet replacement. Compatible with iOS By default, IBActionSheet mimics the iOS 7/8 UIActionSheet exactly: - + ![Standard](https://raw.github.com/ianb821/IBActionSheet/master/Pictures/Standard.png) @@ -22,25 +22,25 @@ You then have the option to change: - The button backround highlight color - The button and title font - The effect when a button is pressed - + ####A simple example is shown here: - + ![Colored](https://raw.github.com/ianb821/IBActionSheet/master/Pictures/Colored.png) - + ####An extreme example with every element of the action sheet customized is show here (landscape): - + ![Funky](https://raw.github.com/ianb821/IBActionSheet/master/Pictures/Funky_Landscape.png) - + All but the 'button press' effects can be customized for the whole action sheet, or for individual buttons and title. The 'button press' effects current include: - Fade - Highlight (With designated background and text highlight colors) - Shrink Effect - Reverse Colors (Same as highlight, but it reverses background and text colors) - - + + ##Usage - + IBActionSheet offers the same functionality as the UIActionSheet, including things like: ``` @@ -66,7 +66,7 @@ IBActionSheet offers the same functionality as the UIActionSheet, including thin ``` -To receive notifications from the IBActionSheet, just add +To receive notifications from the IBActionSheet, just add `````` to your view controller's header file, and implement the following method: @@ -77,6 +77,14 @@ To receive notifications from the IBActionSheet, just add It behaves just like the UIActionSheet method, and in fact, it will receive notifications from a UIActionSheet as well. +You can add these optional methods, which also behave like their UIActionSheet equivalents: + +``` +-(void)actionSheet:(IBActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex; +-(void)actionSheet:(IBActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex; + +``` + Then you get to the good stuff, to customize the action sheet, you can choose from the following: ``` @@ -117,19 +125,19 @@ Then you get to the good stuff, to customize the action sheet, you can choose fr I have included a super simple sample project that will show you how it works. Please let me know if you have any questions or suggestions! ***Note: If you are running this app on iOS 7, make sure that you change the deployment target to 7.0 before installing it on a device running 7.0. If not, the animation will be slightly off - + ##Known Issues - On iPad, it follows the iPhone style UIActionSheet instead of the iPad one. I personally prefer this behavior, but if there is a demand, I'm happy to make it follow the UIActionSheet behavior for iPad, just let me know! - + - IBActionSheet doesn't lock orientation as UIActionSheet does. I haven't found an elegant solution to this just yet. You can use the actionSheet.visible property to lock it yourself, or you call: - + ``` [actionSheet rotateToCurrentOrientation]; ``` - from whatever method you are using to detect rotation and it will resize accordingly. - + from whatever method you are using to detect rotation and it will resize accordingly. + - When adding IBActionSheet to a UIView contained in a UINavigation Controller, use: ``` @@ -141,4 +149,3 @@ instead of: [actionSheet showInView:self.view]; ``` hopefully I can eliminate the need to do this in the future. -