Git Product home page Git Product logo

rglalertview's Introduction

RGLAlertView

RGLAlertView

A nicely alternative way to present alert views, add colors, text, customize them with images, and everything as easy as including a string.

Featuring

  • As easy as entering a string.
  • For all devices, calculated sizes dinamically.
  • With multiple animations to present the alert.
  • Know which button is tapped.
  • Add up to 3 buttons in an alert.
  • Add images to customize it more.

Usage

Import the main file into your Xcode project and import it in the view controller you want the view to appear:

#import "RGLAlertView.h"

In the view you want, instantiate the view, and present it.

Create a simple alert

RGLAlertView *view = [[RGLAlertView alloc] initWithBodyMessage:@"This is an alert view with a title" andDismissButtonText:@"Dismiss"];
[view setTitle:@"Alert with title"];
[view presentAlertViewWithAnimation:0];

Add more stuff into the alert

RGLAlertView *view = [[RGLAlertView alloc] initWithBodyMessage:@"This is an alert view with a title" andDismissButtonText:@"Dismiss"];
[view setTitle:@"Alert with title"];
[view setBody:@"This is some random text, funny thing about it is that, based in my size, the alert is going to get bigger and bigger!"];
[view addButtonWithTitle:@"Touch"];
[view addImageInTop:[UIImage imageNamed:@"firstImage"]];
[view presentAlertViewWithAnimation:0];

Use the delegate

With the delegate you're going to be able to know which button is getting tapped. Is that easy:

view.delegate = self;

And then call the methods

- (void)buttonDidPressedWithTitle:(NSString *)string
{
    NSLog(@"%@", string);
}
- (void)buttonDismissDidPressed
{

}

Example

RGLAlertView

Upcoming features

  • TextField support, you're going to be able to listen to some methods once you are typing.
  • Adding custom fonts into the alert view.
  • More customization (ideas?).

Contributing

  1. Fork it.
  2. Create your branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -am 'Added this feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create new pull request.

Done by

Ramon Gilabert with love! :)

rglalertview's People

Contributors

ramongilabert 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.