2008-03-08 23:58:52 +00:00
|
|
|
//
|
|
|
|
// ToggleQueueTitleTransformer.m
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Vincent Spader on 3/8/08.
|
|
|
|
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "ToggleQueueTitleTransformer.h"
|
|
|
|
|
2013-10-11 12:03:55 +00:00
|
|
|
#import "Logging.h"
|
2008-03-08 23:58:52 +00:00
|
|
|
|
|
|
|
@implementation ToggleQueueTitleTransformer
|
|
|
|
|
|
|
|
|
2008-03-09 02:53:13 +00:00
|
|
|
+ (Class)transformedValueClass { return [NSNumber class]; }
|
2008-03-08 23:58:52 +00:00
|
|
|
+ (BOOL)allowsReverseTransformation { return NO; }
|
|
|
|
|
|
|
|
// Convert from NSNumber to NSString
|
|
|
|
- (id)transformedValue:(id)value {
|
2013-10-11 12:03:55 +00:00
|
|
|
DLog(@"VALUE: %@", value);
|
2008-03-08 23:58:52 +00:00
|
|
|
if (value == nil) return nil;
|
2008-03-09 02:53:13 +00:00
|
|
|
BOOL queued = [value boolValue];
|
2008-03-08 23:58:52 +00:00
|
|
|
|
2008-03-09 02:53:13 +00:00
|
|
|
if (queued)
|
|
|
|
{
|
2008-03-08 23:58:52 +00:00
|
|
|
return @"Remove from Queue";
|
2008-03-09 02:53:13 +00:00
|
|
|
}
|
2008-03-08 23:58:52 +00:00
|
|
|
else
|
2008-03-09 02:53:13 +00:00
|
|
|
{
|
|
|
|
return @"Add to Queue";
|
|
|
|
}
|
2008-03-08 23:58:52 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@end
|