Code Monkey home page Code Monkey logo

agpushnote's Introduction

AGPushNote

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

  • Will look like 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:

#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...
    }];
  • 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:

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() ...

Things to see, stuff to do, places to go

  • Add cool parallax effect to the iOS7 view (Supposed to be easy, less easy when subclassing UIToolbar instead UIView...).
  • Add option to put small icon next to the message.
  • Add option to switch the X button to the right side.

Credits

AGNoteView was created by Aviel Gross in the development of TLV Airport

agpushnote's People

Contributors

avielg avatar jookwang-park avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

agpushnote's Issues

super.view hijacking click event when click on push view button.

I made close button on push view of right side.

just ...that button for close push view
but did not work when click that button because super view navigation bar button is firstly.

so I was add code here

[APP.window addSubview:PUSH_VIEW]; // pre-written code
[APP.window bringSubviewToFront:PUSH_VIEW]; //additional code

but same issue occured.

I test this few times, I know that move other page view until did not close push view.
so... It solution maybe. push view bringFrontAlways.
but I dont know that how

finaly I found this!
when U have a agpushnote, If your app moved other viewController
then AGPushNote does not close

and solution here.

-(void) viewWillAppear:(BOOL)animated{ NSArray * subviews = [[[[UIApplication sharedApplication] delegate ] window] subviews]; subviews = [[[[UIApplication sharedApplication] delegate ] window] subviews]; for(UIView *view in subviews){ if([view isKindOfClass:[AGPushNoteView class]]){ [[[[UIApplication sharedApplication] delegate ] window] bringSubviewToFront:view]; } } }

Apps run on iPad with landscape orientation

First of all, thanks for the great library!

I am currently using this library to build an iPad apps, and is in landscape orientation.
How can I display the push note on top of the screen rather than on the left hand side of the screen? ( Since this is correct if the apps is run on portrait mode)

Thanks for the help.

Not working in iOS 10

Hii avielg,

This class is not working in iOS 10. We can not able to show background color of notification.

How can I solve this issue for iOS 10. It is working for iOS 8 and 9.

Thanks,
Meet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.