forked from alisdair/Nodobo-Replay
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOrientation.m
46 lines (35 loc) · 813 Bytes
/
Orientation.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
//
// Orientation.m
// Nodobo Replay
//
// Created by Alisdair McDiarmid on 05/08/2010.
// Copyright 2010 Nodobo. All rights reserved.
//
#import "Orientation.h"
@implementation Orientation
@synthesize rotation;
+ (Orientation * ) orientationWithRotation: (NSUInteger) r timestamp: (NSDate *) t
{
return [[[Orientation alloc] initWithRotation: r timestamp: t] autorelease];
}
- (Orientation * ) initWithRotation: (NSUInteger) r timestamp: (NSDate *) t
{
self = [super init];
if (self == nil)
return nil;
rotation = r;
timestamp = [t retain];
return self;
}
- (NSString *) data
{
switch (rotation) {
case 0:
return @"Portrait";
case 1:
return @"Landscape";
default:
return nil;
}
}
@end