Skip to content

Commit

Permalink
Change view used for show the notification in demo and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ajerez committed Sep 1, 2013
1 parent 94ddeb3 commit 3562a82
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions AJNotificationViewDemo/AJNotificationViewDemo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ - (IBAction)hideNotification:(id)sender {
- (IBAction)showNotificactionWithoutlines:(id)sender {

//Default demo
[AJNotificationView showNoticeInView:self.view
[AJNotificationView showNoticeInView:[[[UIApplication sharedApplication] delegate] window]
type:AJNotificationTypeDefault
title:@"Information notification"
linedBackground:AJLinedBackgroundTypeDisabled
hideAfter:2.5f];
}
- (IBAction)showBlueNotification:(id)sender {
//Demo with response block
[AJNotificationView showNoticeInView:self.view
[AJNotificationView showNoticeInView:[[[UIApplication sharedApplication] delegate] window]
type:AJNotificationTypeBlue
title:@"Success notification 1 (Blue) 12312312312312312312 3123123123123123123123123 1231231231231231231231231231 23123123123123123123123123123123"
linedBackground:AJLinedBackgroundTypeAnimated
Expand All @@ -84,7 +84,7 @@ - (IBAction)showBlueNotification:(id)sender {

- (IBAction)showBlueNotificationWithoutlines:(id)sender {
//Demo with offset, delay and response block
[AJNotificationView showNoticeInView:self.view
[AJNotificationView showNoticeInView:[[[UIApplication sharedApplication] delegate] window]
type:AJNotificationTypeBlue
title:@"Success notification 2 (Blue)"
linedBackground:AJLinedBackgroundTypeDisabled
Expand All @@ -98,37 +98,37 @@ - (IBAction)showBlueNotificationWithoutlines:(id)sender {
}

- (IBAction)showGreenNotification:(id)sender {
[AJNotificationView showNoticeInView:self.view
[AJNotificationView showNoticeInView:[[[UIApplication sharedApplication] delegate] window]
type:AJNotificationTypeGreen
title:@"Success notification 1 (Green)"
hideAfter:2.5f];
}

- (IBAction)showGreenNotificationWithoutlines:(id)sender {
[AJNotificationView showNoticeInView:self.view
[AJNotificationView showNoticeInView:[[[UIApplication sharedApplication] delegate] window]
type:AJNotificationTypeGreen
title:@"Success notification 2 (Green)"
linedBackground:AJLinedBackgroundTypeDisabled
hideAfter:2.5f];
}

- (IBAction)showRedNotification:(id)sender {
[AJNotificationView showNoticeInView:self.view
[AJNotificationView showNoticeInView:[[[UIApplication sharedApplication] delegate] window]
type:AJNotificationTypeRed
title:@"Error notification"
hideAfter:2.5f];
}

- (IBAction)showRedNotificationWithoutlines:(id)sender {
[AJNotificationView showNoticeInView:self.view
[AJNotificationView showNoticeInView:[[[UIApplication sharedApplication] delegate] window]
type:AJNotificationTypeRed
title:@"Error notification"
linedBackground:AJLinedBackgroundTypeDisabled
hideAfter:2.5f];
}

- (IBAction)showOrangeNotification:(id)sender {
[AJNotificationView showNoticeInView:self.view
[AJNotificationView showNoticeInView:[[[UIApplication sharedApplication] delegate] window]
type:AJNotificationTypeOrange
title:@"Warning notification"
linedBackground:AJLinedBackgroundTypeAnimated
Expand All @@ -145,7 +145,7 @@ - (IBAction)showOrangeNotificationWithoutlines:(id)sender {
title = @"Detail disclosure and long long long long long long long long text";
}

[AJNotificationView showNoticeInView:self.view
[AJNotificationView showNoticeInView:[[[UIApplication sharedApplication] delegate] window]
type:AJNotificationTypeBlue
title:title
linedBackground:AJLinedBackgroundTypeAnimated
Expand Down
10 changes: 5 additions & 5 deletions Readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Add __QuartzCore.framework__ and drop the __AJNotificationView__ folder in your

``` objective-c
//Blue notification with animated lined background. Hides after 2,5 seg
[AJNotificationView showNoticeInView:self.view
[AJNotificationView showNoticeInView:[[[UIApplication sharedApplication] delegate] window]
type:AJNotificationTypeBlue
title:@"Test notification"
linedBackground:AJLinedBackgroundTypeAnimated
Expand All @@ -41,7 +41,7 @@ Add __QuartzCore.framework__ and drop the __AJNotificationView__ folder in your
``` objective-c
// Orange notification without lined background. Remains visible until the user taps in it, or you call hide method
AJNotificationView *panel = [AJNotificationView showNoticeInView:self.view
AJNotificationView *panel = [AJNotificationView showNoticeInView:[[[UIApplication sharedApplication] delegate] window]
type:AJNotificationTypeOrange
title:@"Test notification"
linedBackground:AJLinedBackgroundTypeDisabled
Expand All @@ -54,7 +54,7 @@ AJNotificationView *panel = [AJNotificationView showNoticeInView:self.view
``` objective-c
// Notification with delay, offset and response block that's called when the user tap in it.
//Thanks to @DazeEnd for this awesome features
[AJNotificationView showNoticeInView:self.view
[AJNotificationView showNoticeInView:[[[UIApplication sharedApplication] delegate] window]
type:AJNotificationTypeBlue
title:@"Oppa Gangnam Style!"
linedBackground:AJLinedBackgroundTypeDisabled
Expand All @@ -73,7 +73,7 @@ AJNotificationView *panel = [AJNotificationView showNoticeInView:self.view
//Thanks to @smoothdvd for this last feature
//In viewDidLoad register the NSNotification
- (void)viewDidLoad{
- (void)viewDidLoad {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(detailDisclosureButtonPressed:)
name:@"detail_disclosure_button_pressed"
Expand All @@ -83,7 +83,7 @@ AJNotificationView *panel = [AJNotificationView showNoticeInView:self.view
//...
//Function that's called when the NSNotification is fired
- (void)detailDisclosureButtonPressed:(NSNotification*)notification{
- (void)detailDisclosureButtonPressed:(NSNotification*)notification {
NSLog(@"Detail disclosure button pressed");
}
Expand Down

0 comments on commit 3562a82

Please sign in to comment.