Skip to content

Commit

Permalink
Add optional delegate methods to README.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Hudson committed Apr 27, 2015
1 parent de73fd6 commit 19b6524
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
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.
##Features

By default, IBActionSheet mimics the iOS 7/8 UIActionSheet exactly:



![Standard](https://raw.github.com/ianb821/IBActionSheet/master/Pictures/Standard.png)

Expand All @@ -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:

```
Expand All @@ -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
```<IBActionSheetDelegate>``` to your view controller's header file, and implement the following method:


Expand All @@ -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:

```
Expand Down Expand Up @@ -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:

```
Expand All @@ -141,4 +149,3 @@ instead of:
[actionSheet showInView:self.view];
```
hopefully I can eliminate the need to do this in the future.

0 comments on commit 19b6524

Please sign in to comment.