Giter VIP home page Giter VIP logo

ehplainalert's Introduction

EHPlainAlert

This is simple extension for presenting multiple system-wide notifications from bottom of device screen.

Requirements

  • Requires iOS 7.1 or later
  • Requires Automatic Reference Counting (ARC)

##Features

  • Supports multiple messages on one screen
  • Simple use actions
  • Highly customizable

Installation

CocoaPods

To install SDCAlertView using CocoaPods, please integrate it in your existing Podfile, or create a new Podfile:

platform :ios, '7.1'

target 'MyApp' do
  pod 'EHPlainAlert'
end

Then run pod install.

Manual

Add EHPlainAlert folder to your project

##Usage

#import <EHPlainAlert/EHPlainAlert.h>

###Presenting notification

All messages can simply presented via static method call:

[EHPlainAlert showAlertWithTitle:@"Success" message:@"Something works!" type:ViewAlertSuccess];

###Presenting error notification

For simplifying error handling you can use:

- (void)someError:(NSError *)myError
{
	[EHPlainAlert showError:error];
}

###Hiding Messages

Notifications will hidden automatically after 4 seconds. You can override EHDEFAULT_HIDING_DELAY for change this behavior.

Also you can just tap on message to hide it.

###On Tap Actions

You can change the default behavior for tapping on the notification:

EHPlainAlert * ehAlert = [[EHPlainAlert alloc] initWithTitle:@"Hmm..." message:@"Tap for information" type:ViewAlertInfo];
ehAlert.action = ^{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/josshad/EHPlainAlert"]];
};
[ehAlert show];

###Customization

Fonts:

EHPlainAlert * ehAlert = [[EHPlainAlert alloc] initWithTitle:@"Info" message:@"This is info message" type:ViewAlertInfo];
ehAlert.titleFont = [UIFont fontWithName:@"TrebuchetMS" size:15];
ehAlert.subTitleFont = [UIFont fontWithName:@"TrebuchetMS-Italic" size:12];
[ehAlert show];

Colors:

EHPlainAlert * ehAlert = [[EHPlainAlert alloc] initWithTitle:@"Hmm..." message:@"Blue color alert" type:ViewAlertInfo];
ehAlert.messageColor = [UIColor blueColor];
[ehAlert show];

##Author Danila Gusev

[email protected]

License

Usage is provided under the MIT License. See LICENSE for full details.

ehplainalert's People

Contributors

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