Coder Social home page Coder Social logo

honood / doactionsheet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from donobono/doactionsheet

0.0 1.0 0.0 1.67 MB

An replacement for UIActionSheet : block-based, customizable theme, easy to use with image or map

License: MIT License

Objective-C 97.22% Ruby 2.78%

doactionsheet's Introduction

DoActionSheet

An replacement for UIActionSheet : block-based, customizable theme, easy to use with image or map

Preview

with title, with destructive button, with cancel button and with image

DoAlertView Screenshot

support scroll if there are many buttons but cancel button’s position is fixed

DoAlertView Screenshot

customizable color set

DoAlertView Screenshot

with map

DoAlertView Screenshot

Requirements

  • iOS 7.0 and greater
  • ARC

Examples

Code:

DoActionSheet *vActionSheet = [[DoActionSheet alloc] init];
// required
vActionSheet.nAnimationType = _sgType.selectedSegmentIndex;	// there are 3 type of animation

// optional
vActionSheet.dButtonRound = 2;	

// with image
vActionSheet.iImage = [UIImage imageNamed:@"pic1.jpg"];
vActionSheet.nContentMode = DoContentImage;


// with map
vActionSheet.nContentMode = DoContentMap;
vActionSheet.dLocation = @{@"latitude" : @(37.78275123), @"longitude" : @(-122.40416442), @"altitude" : @200};


// launch DoActionSheet! - With destructive button, cancel button and title
vActionSheet.nDestructiveIndex = 2;

[vActionSheet showC:@"What do you want for this photo?"
             cancel:@"Cancel"
            buttons:@[@"Post to facebook", @"Post to Instagram", @"Delete this photo"]
             result:^(int nResult) {
                 
                 NSLog(@"---------------> result : %d", nResult);
                 
             }];


// launch DoActionSheet! - With title and without cancel button
[vActionSheet show:@"What do you want?"
            buttons:@[@"Open with Safari", @"Copy the link"]
            result:^(int nResult) {
                
                NSLog(@"---------------> result : %d", nResult);
                
            }];
// customizable theme
#define DO_BACK_COLOR               DO_RGB(232, 229, 222)

// button background color
#define DO_BUTTON_COLOR             DO_RGB(158, 132, 103)
#define DO_CANCEL_COLOR             DO_RGB(240, 185, 103)
#define DO_DESTRUCTIVE_COLOR        DO_RGB(124, 192, 134)

// button text color
#define DO_TITLE_TEXT_COLOR         DO_RGB(95, 74, 50)
#define DO_BUTTON_TEXT_COLOR        DO_RGB(255, 255, 255)
#define DO_CANCEL_TEXT_COLOR        DO_RGB(255, 255, 255)
#define DO_DESTRUCTIVE_TEXT_COLOR   DO_RGB(255, 255, 255)

Credits

DoActionSheet was created by Dono Cho.

License

DoActionSheet is available under the MIT license. See the LICENSE file for more info.

doactionsheet's People

Contributors

donobono avatar honood avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.