-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAQGridViewAnimatorItem.m
More file actions
62 lines (50 loc) · 1.22 KB
/
AQGridViewAnimatorItem.m
File metadata and controls
62 lines (50 loc) · 1.22 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// AQGridViewAnimatorItem.m
// Kobov3
//
// Created by Jim Dovey on 10-06-29.
// Copyright 2010 Kobo Inc. All rights reserved.
//
#import "AQGridViewAnimatorItem.h"
@implementation AQGridViewAnimatorItem
@synthesize animatingView, index;
+ (AQGridViewAnimatorItem *) itemWithView: (UIView *) aView index: (NSUInteger) anIndex
{
AQGridViewAnimatorItem * result = [[self alloc] init];
result.animatingView = aView;
result.index = anIndex;
return ( [result autorelease] );
}
- (void) dealloc
{
self.animatingView = nil;
[super dealloc];
}
- (NSUInteger) hash
{
return ( self.index );
}
- (BOOL) isEqual: (AQGridViewAnimatorItem *) o
{
if ( [o isKindOfClass: [self class]] == NO )
return ( NO );
return ( o.index == self.index );
}
- (NSComparisonResult) compare: (id) obj
{
if ( [obj isKindOfClass: [self class]] == NO )
{
if ( (id)self < obj )
return ( NSOrderedAscending );
if ( (id)self > obj )
return ( NSOrderedDescending );
return ( NSOrderedSame ); // how ??!?!?
}
AQGridViewAnimatorItem * item = (AQGridViewAnimatorItem *) obj;
if ( self.index < item.index )
return ( NSOrderedAscending );
if ( self.index > item.index )
return ( NSOrderedDescending );
return ( NSOrderedSame );
}
@end