Skip to content

Latest commit

 

History

History
49 lines (30 loc) · 1.66 KB

README.md

File metadata and controls

49 lines (30 loc) · 1.66 KB

NoticeView

A TweetBot-like notice component for iOS.


![Alt text](http://cloud.github.com/downloads/tciuro/NoticeView/screenshot.png)

Usage

  • Drop the WBNoticeView folder in your project
  • Add QuartzCore.framework to your project

Examples

To display a small error notice:

WBNoticeView *nm = [WBNoticeView defaultManager];
[nm showErrorNoticeInView:self.view title:@"Network Error" message:@"Check your network connection."];

To display a large error notice, make the text long enough to wrap to another line. Only two lines are supported. If the text doesn't fit in two lines, an ellipsis will be appended at the end of the second line:

WBNoticeView *nm = [WBNoticeView defaultManager];
[nm showErrorNoticeInView:self.view title:@"Network Error" message:@"Check your network connection. Twitter could also be down."];

To display a small success notice:

WBNoticeView *nm = [WBNoticeView defaultManager];
[nm showSuccessNoticeInView:self.view message:@"Link Saved Successfully"];

Notes

If you pass nil instead of a valid UIView, an NSInvalidArgumentException exception will be raised.

The default values are the following:

    if (nil == title) title = @"Unknown Error";
    if (nil == message) message = @"Information not provided.";
    if (0.0 == duration) duration = 0.3;
    if (0.0 == delay) delay = 2.0;

Contribute

I'd love to include your contributions. Feel free to improve it, send comments or suggestions. If you have improvements please send me a pull request.

Contact Me

You can ping me on Twitter — @titusmagnus.