Skip to content

Instantly share code, notes, and snippets.

@reddavis
Created April 22, 2012 14:09
Show Gist options
  • Save reddavis/2464265 to your computer and use it in GitHub Desktop.
Save reddavis/2464265 to your computer and use it in GitHub Desktop.
//
// RDViewController.m
// RDNotificationExample
//
// Created by Red Davis on 22/04/2012.
// Copyright (c) 2012 Red Davis. All rights reserved.
//
#import "RDViewController.h"
#import "RDNotification.h"
@interface RDViewController ()
@end
@implementation RDViewController
#pragma mark - View lifecycle
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)viewDidUnload {
[super viewDidUnload];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
#pragma mark - Actions
- (void)showNotificationAtTop:(id)sender {
RDNotification *notification = [[RDNotification alloc] initWithNotificationType:RDNotificationTypeSuccess];
notification.text = @"This has been a success";
[notification showAtTop];
}
- (void)showNotificationAtY:(id)sender {
RDNotification *notification = [[RDNotification alloc] initWithNotificationType:RDNotificationTypeError];
notification.text = @"This has been a error";
[notification showAt:100];
}
- (void)showNotificationAboveView:(id)sender {
RDNotification *notification = [[RDNotification alloc] initWithNotificationType:RDNotificationTypeSuccess];
notification.text = @"This has been a success";
notification.animationTime = 3;
notification.animationPauseTime = 2.5;
[notification showAboveView:self.tabBarController.tabBar];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment