Created
April 22, 2012 14:09
-
-
Save reddavis/2464265 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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