Giter VIP home page Giter VIP logo

uinoticesheet's Introduction

UINoticeSheet

An UINoticeSheet for the iOS platform. Shows a noticesheet at top of screen.

How to

  1. Add QuartzCore framework to your project. This is needed to draw a nice shadow below the notice
  2. Copy the NoticeSheet folder to your project
  3. #import "NoticeSheet.h"
  4. Start displaying the sheets
- (IBAction)displaySample1:(id)sender
{
    [NoticeSheet showNotice:@"This is a notice sheet"];
}

- (IBAction)displaySample2:(id)sender
{
    [NoticeSheet showNotice:@"This is a notice sheet that you can press" selector:@selector(doSomething) target:self];
}

- (void) doSomething
{
    NSLog(@"Notice was pressed!");
}

Other ways of invoking a sheet

/**
 * Shows a notice sheet with text as message. Uses the topmost view to display from.
 *
 * @param NSString The text to display
 */
+ (void) showNotice:(NSString*) text;

/**
 * Shows a notice sheet with a text as message in a specific view
 *
 * @param NSString The tex to tisplay
 * @param UIView the view the sheet should be displayed in
 */
+ (void) showNotice:(NSString*) text inView:(UIView*)view;

/**
 * Shows a notice sheet with text as message and when a user touches the view, selector will be fired on target. Uses the topmost view to display from.
 *
 * @param NSString The text to display
 * @param SEL The selector to call (the method on target)
 * @param id The target to call selector on
 */
+ (void) showNotice:(NSString *)text selector:(SEL)selector target:(id)target;

/**
 * Shows a notice sheet with text as message and when a user touches the view, selector will be fired on target
 * The notice will be shown in the view that is provided.
 *
 * @param NSString The text to display
 * @param SEL The selector to call (the method on target)
 * @param id The target to call selector on
 * @param UIView the view the sheet should be displayed in
 */
+ (void) showNotice:(NSString *)text selector:(SEL)selector target:(id)target inView:(UIView *)view;

Example

Look and feel can easily be modified by modifing setupSubviews in NoticeView class.

image1

uinoticesheet's People

Contributors

styrken avatar

Stargazers

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