Custom view for easily displaying in-app push notification that feels like default iOS banners.
Custom view for easily displaying in-app push notification that feels like default iOS banners.
showWithNotificationMessage:
repeatedly to see how this works (Shown in the example app).setMessageAction:
to set it).This is a one liner. Simply import and call this method to show a message:
#import "AGPushNoteView.h"
.
.
[AGPushNoteView showWithNotificationMessage:@"John Doe sent you a message!"];
To set the action for when the user tap the message, call:
[AGPushNoteView setMessageAction:^(NSString *message) {
// Do something...
}];
message
object in the block will be the message the user tapped on.To use the delegate methods call:
id <AGPushNoteViewDelegate> someObj...
[AGPushNoteView setDelegateForPushNote:someObj];
To use the timer to auto hide the view after showing it, finds this line and remove the comment from it:
@implementation AGPushNoteView
.
.
PUSH_VIEW.closeTimer = [NSTimer...
The default 5 seconds delay is set in a define in the head of the .m
file:
#define CLOSE_PUSH_SEC 5
.
.
@interface AGPushNoteView() ...
UIToolbar
instead UIView
…).AGNoteView was created by Aviel Gross in the development of TLV Airport