Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
avielg committed Apr 29, 2014
1 parent ceed1e6 commit f86e4ab
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,56 @@ AGPushNote
==========

Custom view for easily displaying in-app push notification that feels like default iOS banners.


* Will look liks iOS7 on iOS7 and will (try to) look like iOS6 on iOS6.
* Both block and protocol ways are available to control the action of tapping the message and showing/dismissing the view.
* Automatic handling for more than 1 push - Try calling `showWithNotificationMessage:` repeatedly to see how this works (Shown in the example app).
* Action block for tapping the message can be changed at any time - even after the view is already on screen! (Use `setMessageAction:` to set it).
* Optionaly hide the view after X seconds (Default is 5), remove comment in code the make this work...

## Usage

This is a one liner. Simply import and call this method to show a message:
```objc
#import "AGPushNoteView.h"
.
.
[AGPushNoteView showWithNotificationMessage:@"John Doe sent you a message!"];
```
To set the action for when the user tap the message, call:
```objc
[AGPushNoteView setMessageAction:^(NSString *message) {
// Do something...
}];
```
* Since AGPushNote can handle showing multiple notifications, the `message` object in the block will be the message the user tapped on.


## More Stuff

To use the delegate methods call:
```objc
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:
```objc
@implementation AGPushNoteView
.
.
PUSH_VIEW.closeTimer = [NSTimer...
```
The default 5 seconds delay is set in a define in the head of the `.m` file:
```objc
#define CLOSE_PUSH_SEC 5
.
.
@interface AGPushNoteView() ...
```
## Credits
AGNoteView was created by [Aviel Gross](http:https://bit.ly/aviel) in the development of [TLV Airport](https://itunes.apple.com/us/app/tel-aviv-int-airport-nml-t/id796888961?mt=8)

0 comments on commit f86e4ab

Please sign in to comment.