GithubHelp home page GithubHelp logo

honood / doalertview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from donobono/doalertview

0.0 1.0 0.0 874 KB

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

License: MIT License

Objective-C 97.40% Ruby 2.60%

doalertview's Introduction

DoAlertView

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

Preview

with title, with yes button, with no button

DoAlertView Screenshot

without title, with yes button, with no button, with an image, destructive mode

DoAlertView Screenshot

without title, with only yes button, with a map

DoAlertView Screenshot

Requirements

  • iOS 7.0 and greater
  • ARC

Examples

Code:

_vAlert = [[DoAlertView alloc] init];
// required
_vAlert.nAnimationType = _sgType.selectedSegmentIndex;	// there are 5 type of animation

// optional
_vAlert.dRound = 2.0;
_vAlert.bDestructive = NO;	// for destructive mode

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

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

// launch with title, yes button and no button
[_vAlert doYesNo:@"Title"
            body:@"Here’s a snippet of code that illustrates how the whole process works"
             yes:^(DoAlertView *alertView) {
              
                 NSLog(@"Yeeeeeeeeeeeees!!!!");

             } no:^(DoAlertView *alertView) {

                 NSLog(@"Noooooooooooooo!!!!");
               
             }];


// launch with only yes button
_vAlert.bDestructive = YES;
[_vAlert doYes:@"Here’s a snippet of code that illustrates how the whole process works"
           yes:^(DoAlertView *alertView) {
               
               NSLog(@"Yeeeeeeeeeeeees!!!!");
               
           }];

// launch with timer, without any buttons
[_vAlert doAlert:@"Please wait a second!"
            body:@"Getting great data from server..."
        duration:0.0
            done:^(DoAlertView *alertView) {
                
                NSLog(@"Done!!!!");
                
            }];
// customizable theme
#define DO_TITLE_BOX                DO_RGB(218, 247, 244)
#define DO_NORMAL_BOX               DO_RGB(255, 255, 255)
#define DO_BUTTON_BOX               DO_RGB(13, 52, 85)
#define DO_DESTRUCTIVE_BOX          DO_RGB(236, 90, 73)
#define DO_TEXT_COLOR               DO_RGB(13, 52, 85)
#define DO_DESTRUCTIVE_TEXT_COLOR   DO_RGB(255, 255, 255)
#define DO_DIMMED_COLOR             DO_RGBA(0, 0, 0, 0.7)

#define DO_TEXT_FONT        [UIFont fontWithName:@"Avenir-Medium" size:14]
#define DO_BOLD_FONT        [UIFont fontWithName:@"Avenir-Heavy" size:14]

#define DO_LABEL_INSET      UIEdgeInsetsMake(10, 10, 10, 10)
#define DO_TITLE_INSET      UIEdgeInsetsMake(5, 10, 5, 10)
#define DO_VIEW_WIDTH       280

Credits

DoAlertView was created by Dono Cho.

License

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

doalertview'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.