-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestViewController.m
More file actions
47 lines (40 loc) · 1.08 KB
/
TestViewController.m
File metadata and controls
47 lines (40 loc) · 1.08 KB
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
//
// TestViewController.m
// Slider
//
// Created by Vincent Pillinger on 1/27/14.
// Copyright (c) 2014 Vincent Pillinger. All rights reserved.
//
#import "TestViewController.h"
@interface TestViewController ()
@end
@implementation TestViewController
@synthesize slider;
@synthesize label;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self valueChanged:nil];
}
- (void)viewDidUnload
{
[self setSlider:nil];
[self setLabel:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
return YES;
}
}
- (IBAction)valueChanged:(id)sender {
double sliderValue = [slider value];
NSString *labelText = [NSString stringWithFormat:@"%f",sliderValue];
[label setText:labelText];
}
@end