NotificationManager can be used to display notifications from any part of your app to the user; similar to the Game Center notifications, but with more features.
- 9 Different styles to choose from
- Can be used with or without an icon
- Custom duration
- Multi-line text
- Customizable look
- Perform an action when notification is tapped
- Adjusts to any device orientation
- Supported on iPhone and iPad with iOS 3.2 onwards
-
Add the
QuartzCore
Framework to your Xcode project -
Add the following files to your Xcode project (make sure to select Copy Items in the dialog):
- NotificationManager.h
- NotificationManager.m
- Import the
NotificationManager.h
file
To display a notification, call:
[NotificationManager notifyText:@"This is a notification." icon:@"icon_info.png" style:NotificationStyleSlideInTop duration:2 target:nil selector:nil showImmediately:NO];
- Pass a
nil
parameter toicon
to not display an icon - To perform a selector when the notification is tapped, specify a target and selector
- Notifications are queued and are shown one by one. If you want to skip the queue, pass a
YES
parameter toshowImmediately
To customize the look of the notifications, open the NotificationManager.h
file and change the defined constants to alter the font, size and colors.