- Author: Richard Jung
- Version: 1.1
- State: Beta
nNotification is an iOS class to show a message for a specific time. It is very easy to use and a elegant way to inform the user about any information.
Inspired by Toast from Android.
- iOS 4.X
- UIKit
- Foundation
- QuarzCore
- Drag the files (nNotification.h, nNotification.m) into your Project or add it through the "Add Files to XXX ...".
- Add QuartzCore framework to your project: Click on your project, choose your target, click on "Build Phases", choose "Link Binary With Libraries" and add it via "+".
- Import it where do you want to use it:
#import "nNotification.h"
[nNotification showMessage:@"Your message!"];
nNotificaiton *notification = [nNotification notificationWithMessage:@"Your Message"];
notification.width = 200;
notification.height = 200;
notification.modal = YES;
notification.delay = 3;
notification.duration = 5;
[notification show];
// And you can customize UI
nNotification *notification = [nNotification notificationWithMessage:@"Your Message"];
nNotificationExtended extended = notification.extended;
extended.modalBackgroundColor = [UIColor yellowColor];
extended.dialogBackgroundColor = [UIColor redColor];
notification.extended = extended;
[notification show];
message: Defines the shown message.
notification.message = @"Your Message!";
duration: Defines how long (time -> seconds) the dialog will be shown. Default is 2.5 seconds.
notification.duration = 4.0;
width: Defines the width of the shown message dialog.
notification.width = 200;
height: Defines the height of the shown message dialog.
notification.height = 200;
delay: Defines after which delay (time -> seconds) the dialog appears. So you can hold back the dialog a specific time.
notification.delay = 4;
modal: Defines whether the user is allowed to interact with the UI or not. Additionally the whole window will be dimmed.
notification.modal = YES;
extended: Is a struct object, which allows to customize the ui of the dialog.
nNotificationExtended extended = notification.extended;
modalBackgroundColor: [JUST FOR MODAL] Defines the dimming color.
extended.modalBackgroundColor = [UIColor redColor];
dialogBackgroundColor: Defines the background color of the dialog layer.
extended.dialogBackgroundColor = [UIColor yellowColor];
(2011) Copyright by Richard Jung. All rights reserved.
This software / classes are released under the LGPL conditions. Feel free to use it for commercial purposes.