GithubHelp home page GithubHelp logo

pballart / rkdropdownalert Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cwrichardkim/rkdropdownalert

0.0 1.0 0.0 636 KB

iOS / Objective C: an extremely simple UIAlertView alternative

Home Page: https://medium.com/@cwRichardKim/devux-uialertview-alternatives-3a78ab64cbf8

License: MIT License

Ruby 19.72% Objective-C 80.28%

rkdropdownalert's Introduction

RKDropdownAlert

an extremely simple (and customizeable) alert alternative based on Facebook's app Slingshot, and inspiration from SVProgressHUD (yes, it's just as easy to use as SV)

##Updates, Questions, and Requests twitter <--- I am a very light twitterer, so I wont spam you

Article comparing UIAlertView, SVProgressHUD and RKropdownAlert

https://medium.com/@cwRichardKim/devux-uialertview-alternatives-3a78ab64cbf8

##Pod WAIT! Don't use pods if you want to customize or use the quick and easy [RKDropdownAlert show]

pod 'RKDropdownAlert'

##Demo:

[RKDropdownAlert title:@"Hello World" message:@"Tons better than UIAlertView!"];

alt tag

##In Action: first

second

##Easy Default Call

[RKDropdownAlert show];

Set the default text, color, size, font, etc so that when you call "show" it pulls up an easy default call

easy

##Setup

First, download the file, or create a branch of the repo. Copy the following into your parent controller:

#import "RKDropdownAlert.h"

You will probably want to customize the default call ([RKDropdownAlert show]), as well as other features such as color, the method called when the user taps the view, etc. Look for

//%%% CUSTOMIZE

tags in the RKDropdownAlert.m for methods that you should customize.

##Calling the Alert

Use the following variations of title, message, backgroundColor, textColor, and time

+(void)show;
+(void)title:(NSString*)title;
+(void)title:(NSString*)title time:(NSInteger)seconds;
+(void)title:(NSString*)title backgroundColor:(UIColor*)backgroundColor textColor:(UIColor*)textColor;
+(void)title:(NSString*)title backgroundColor:(UIColor*)backgroundColor textColor:(UIColor*)textColor time:(NSInteger)seconds;

+(void)title:(NSString*)title message:(NSString*)message;
+(void)title:(NSString*)title message:(NSString*)message time:(NSInteger)seconds;
+(void)title:(NSString*)title message:(NSString*)message backgroundColor:(UIColor*)backgroundColor textColor:(UIColor*)textColor;
+(void)title:(NSString*)title message:(NSString*)message backgroundColor:(UIColor*)backgroundColor textColor:(UIColor*)textColor time:(NSInteger)seconds;

For example:

[RKDropdownAlert show];

[RKDropdownAlert title:@"this is a title" message:@"this is a one line message"];

[RKDropdownAlert title:@"Hello World" message:@"tons better than UIAlertView" backgroundColor:[UIColor grayColor] textColor:[UIColor whiteColor] time:10];

##Touch Up Inside Method Write your own method for when the user touches the view (default is hide the view)

@interface WhateverClassYouLike : NSObject <RKDropdownAlertDelegate>
@end

@implementation WhateverClassYouLike

-(BOOL)dropdownAlertWasTapped:(RKDropdownAlert*)alert {
	// Handle the tap, then return whether or not the alert should hide.
	return true;
}

@end

alt tag

Areas for Future Improvement / Involvement

  • Improve architecture to maintain single line deployment while also allowing for attribute customization without changing physical code
  • Ability to change layout of text without changing physical code
  • Singleton pattern
  • More rigorous case testing for responsive design (making sure different text lengths still look good)

rkdropdownalert's People

Contributors

andrewbranch avatar chakming avatar cwrichardkim avatar nathankot avatar rockstar avatar sternhenri 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.