LSActionView 1.0.0

LSActionView 1.0.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Feb 2015

Maintained by lslin.



  • By
  • lslin

Alternative to UIActionSheet with a block-based API and a customizable look.

Installation

  • Add LSActionView.h and LSActionView.h to your project.
  • Add #import "LSActionView.h" where your want to use.

Requirements

Requires iOS 4.3 and above.

Usage

  #import "LSActionView.h"

  - (void)onShareTapped:(id)sender {

    //show without button title
    NSArray *images = @[@"icon_dropbox", @"icon_rss", @"icon_facebook", @"icon_twitter"];
    [[LSActionView sharedActionView] showWithImages:images actionBlock:^(NSInteger index) {
        NSLog(@"Action trigger at %ld:", (long)index);
    }]; 

    //show with button title
    NSArray *titles = @[@"Dropbox", @"Rss", @"Facebook", @"Twitter"];
    [[LSActionView sharedActionView] showWithImages:images titles:titles actionBlock:^(NSInteger index) {
        NSLog(@"Action trigger at %ld:", (long)index);
    }];                                             
  }

Customizable

  @property (strong, nonatomic) UIColor *blankAreaColor;
  @property (strong, nonatomic) UIColor *containerColor;
  @property (strong, nonatomic) UIColor *buttonTitleColor;
  @property (assign, nonatomic) CGFloat buttonFontSize;
  @property (assign, nonatomic) CGFloat containerMargin;
  @property (assign, nonatomic) CGFloat buttonIconWidth;
  @property (assign, nonatomic) CGFloat buttonTitleHeight;

Examples

Without title

LSActionView Example1

With title

LSActionView Example2

Landscape

LSActionView Example3