Latest 0.0.1
Homepage https://github.com/larcus94/LBActionSheet
License MIT Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Platforms ios 5.0, requires ARC
Frameworks CoreImage

About

LBActionSheet is a drop-in replacement for UIActionSheet. However, its API makes it very easy to customize it. It’s designed for this sole purpose only which makes it redundant when you don’t need to implement a custom theme.

Usage

LBActionSheet’s API is almost the same as UIActionSheet’s. It might change in the future though. You should hit it off with it anyway.

Installation

  1. Drag the LBActionsSheet folder into your project.
  2. Import the CoreImage.framework.

Example

LBActionSheet* sheet = [[LBActionSheet alloc] initWithTitle:@"Discard?" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Discard" otherButtonTitles:@"Save as draft", nil];   [sheet setDefaultButtonBackgroundImage:[[UIImage imageNamed:@"actionsheet-button"] stretchableImageWithLeftCapWidth:7 topCapHeight:0] forState:UIControlStateNormal];
[sheet setDefaultButtonBackgroundImage:[[UIImage imageNamed:@"actionsheet-button-pressed"] stretchableImageWithLeftCapWidth:7 topCapHeight:0] forState:UIControlStateHighlighted];
    sheet.backgroundImage = [UIImage imageNamed:@"actionsheet-background"];

NSMutableDictionary* titleAttributes = [NSMutableDictionary new];
[titleAttributes setObject:[UIFont fontWithName:@"HelveticaNeue-Bold" size:24.0f] forKey:UITextAttributeFont];
[titleAttributes setObject:[UIColor whiteColor] forKey:UITextAttributeTextColor];
[titleAttributes setObject:[UIColor colorWithWhite:0.0f alpha:0.5f] forKey:UITextAttributeTextShadowColor];
[titleAttributes setObject:[NSValue valueWithCGSize:CGSizeMake(0.0f, 1.0f)] forKey:UITextAttributeTextShadowOffset];
[sheet setButtonTitleAttributes:titleAttributes forState:UIControlStateNormal];
[sheet setButtonTitleAttributes:titleAttributes forState:UIControlStateHighlighted];

UIImageView* separator = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth([UIScreen mainScreen].applicationFrame), 3.0f)];
separator.image = [UIImage imageNamed:@"actionsheet-separator"];
[sheet insertControl:separator atIndex:self.cancelButtonIndex];

[sheet showInView:self.view];

Requirements

ARC.

License

LBActionSheet is licensed under the MIT License.

Latest podspec

{
    "name": "LBActionSheet",
    "version": "0.0.1",
    "summary": "A very customizable drop-in replacement for UIActionSheet",
    "description": "                   LBActionSheet is a drop-in replacement for UIActionSheet. However, its API makes it very easy to customize it.n                   It's designed for this sole purpose only which makes it redundant when you don't need to implement a custom theme.n",
    "homepage": "https://github.com/larcus94/LBActionSheet",
    "license": {
        "type": "MIT",
        "text": "                                                Permission is hereby granted, free of charge, to any person obtaining a copyn                                                of this software and associated documentation files (the "Software"), to dealn                                                in the Software without restriction, including without limitation the rightsn                                                to use, copy, modify, merge, publish, distribute, sublicense, and/or selln                                                copies of the Software, and to permit persons to whom the Software isn                                                furnished to do so, subject to the following conditions:nn                                                The above copyright notice and this permission notice shall be included inn                                                all copies or substantial portions of the Software.nn                                                THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORn                                                IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,n                                                FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEn                                                AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERn                                                LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,n                                                OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INn                                                THE SOFTWARE.n"
    },
    "authors": "Laurin Brandner",
    "platforms": {
        "ios": "5.0"
    },
    "source": {
        "git": "https://github.com/larcus94/LBActionSheet.git",
        "commit": "88bcd764f4285d700a150b62861e0a53542386dd"
    },
    "source_files": "LBActionSheet",
    "frameworks": "CoreImage",
    "requires_arc": true
}

Pin It on Pinterest

Share This