GithubHelp home page GithubHelp logo

santthosh / dmrnotificationview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danielxu/dmrnotificationview

0.0 3.0 0.0 77 KB

DMRNotificationView is a simple panel that slides down to inform the user about something.

License: MIT License

dmrnotificationview's Introduction

DMRNotificationView

DMRNotificationView is a simple panel that slides down to inform the user about something. It has a title and subtitle (optional). You can set custom tint colors (automatically adds 0.85 transparency to tint color), fonts and dismiss interval.

DMRNotificationView

Installation

  • Add the DMRNotificationView.h + DMRNotificationView.m to your project

Usage

Usage is pretty self-explanatory if you check the demo. DMRNotificationView can be used in different ways. It comes with a few convenience initializers which allow you to present the panel in one line of code. See the header file for more methods.

// The most basic method. 
[DMRNotificationView showInView:self.view
                          title:@"Simple notification"
                       subTitle:@"This method allows you to quickly show a notification panel."];

// Use a similar method to show a warning 
[DMRNotificationView showWarningInView:self.view
                               title:@"Warning!"
                            subTitle:@"Simple method to quickly show a warning"];

You can use the default initialiser for advanced usage.

// Create a new DMRNotificationView instance with the default initializer
DMRNotificationView *notificationView = [[DMRNotificationView alloc] initWithTitle:@"Some title" subTitle:@"Some subtitle" targetView:self.view];

// Customise fonts
[notificationView setTitleFont:[UIFont fontWithName:@"MarkerFelt-Thin" size:20.0]];
[notificationView setSubTitleFont:[UIFont fontWithName:@"MarkerFelt-Thin" size:13.0]];

// Customise the time interval which causes the panel to dismiss. Set to 0.0 to disable auto dismiss
[notificationView setHideTimeInterval:6.0];    

// Set a custom tint color. If tint color is bright, the text will be dark, otherwise white. Tint color can't be clearColor or nil
[notificationView setTintColor:[UIColor greenColor]];

// Optionally disable transparency
[notificationView setIsTransparent:NO];   

[notificationView setDidTapHandler:^() {
    // be notified when user taps on panel
}];

[notificationView showAnimated:YES];

Issues

  • Layout issue when changing interface orientation
  • Title can only be one line, no support for long titles

dmrnotificationview's People

Contributors

tursunovic avatar

Watchers

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