forked from onemightyroar/YRDropdownView
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ViewController.m
62 lines (52 loc) · 1.65 KB
/
ViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// ViewController.m
// YRDropdownViewExample
//
// Created by Eli Perkins on 1/27/12.
// Copyright (c) 2012 One Mighty Roar. All rights reserved.
//
#import "ViewController.h"
#import "YRDropdownView.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize demoView;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)viewDidUnload
{
[self setDemoView:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (IBAction)showInView:(id)sender {
[YRDropdownView showDropdownInView:demoView
title:@"Warning"
detail:@"Me too! I want to try a really long detail message to see how it handles the line breaks and what not. Here's to hoping it works right the first time!"
image:[UIImage imageNamed:@"dropdown-alert"]
animated:YES
hideAfter:3];
}
- (IBAction)showInWindow:(id)sender {
[YRDropdownView showDropdownInView:self.view.window
title:@"Warning"
detail:nil
image:nil
animated:NO
hideAfter:0.0];
}
- (IBAction)hide:(id)sender {
[YRDropdownView hideDropdownInView:demoView animated:YES];
}
- (void)dealloc {
[demoView release];
[super dealloc];
}
@end