Latest 0.1.5
Homepage https://github.com/bnolens/TSActionSheet
License MIT
Platforms ios 8.2, requires ARC
Frameworks UIKit
Authors

Build Status

A really easy and beautiful custom UIActionSheet.

Demo

Features

  • Block callback
  • Customizable colors
  • Customizable fonts
  • Customizable background
    • Dimmed black
    • Dimmed white
    • Blurred dark
    • Blurred light
    • Blurred extra light

More info in .h file

How to get started

Download TSActionSheet and try out the included iPhone example apps

1. Install with CocoaPods

Add the following line to your Podfile:

pod 'TSActionSheet'

2. Import

Import TSActionSheet in your project

#import "TSActionSheet.h"

3. Use

Instantiate the actionsheet using:

TSActionSheet *actionSheet = [TSActionSheet new];

Configure it using the parameters:

Look at the .h file to see all the parameters

actionSheet.otherButtonTitles = @[@"Option A", @"Option B", @"Option C"];
actionSheet.destructiveButtonTitle = @"Cancel";

// UI Customization
actionSheet.otherButtonBackgroundColor = [UIColor colorWithWhite:0.94 alpha:1.f];
actionSheet.buttonTitleFont = [UIFont systemFontOfSize:19];
actionSheet.backgroundType = TSActionSheetBackgroundTypeBlurredLight;
actionSheet.destructiveButtonBackgroundColor = [UIColor blackColor];
actionSheet.destructiveButtonTextColor = [UIColor whiteColor];

Set the callback block

actionSheet.tapBlock =  ^(TSActionSheet * as, NSInteger buttonIndex) {

};

Show the actionsheet

[actionSheet showFrom:self];

OR use the class method and do it all in one call

[TSActionSheet showFrom:self
                  withTitle:nil
          cancelButtonTitle:nil
     destructiveButtonTitle:NSLocalizedString(@"Cancel", nil)
          otherButtonTitles:@[NSLocalizedString(@"Option 1", nil), NSLocalizedString(@"Option 2", nil)]
                   tapBlock:^(__unused TSActionSheet * actionSheet, __unused NSInteger buttonIndex) {

    }];

License

License: TSActionSheet

Copyright 2015 Benoit Nolens – http://truestory.io

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.

Latest podspec

{
    "name": "TSActionSheet",
    "version": "0.1.5",
    "platforms": {
        "ios": "8.2"
    },
    "summary": "A really easy and beautiful custom UIActionSheet",
    "description": "A really easy and beautiful custom UIActionSheet.n* Block callbackn* Customizable colorsn* Customizable fontsn* Customizable background",
    "homepage": "https://github.com/bnolens/TSActionSheet",
    "license": {
        "type": "MIT",
        "file": "LICENSE.txt"
    },
    "authors": {
        "Benoit Nolens": "[email protected]"
    },
    "source": {
        "git": "https://github.com/bnolens/TSActionSheet.git",
        "tag": "0.1.5"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*.{h,m}",
    "resource_bundles": {
        "UserInterface": [
            "Pod/Classes/**/*.{xib}"
        ]
    },
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This