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
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
+ (Class)transformedValueClass {
|
|
|
|
return [NSNumber class];
|
|
|
|
}
|
|
|
|
+ (BOOL)allowsReverseTransformation {
|
|
|
|
return NO;
|
|
|
|
}
|
2008-03-08 23:58:52 +00:00
|
|
|
|
|
|
|
// Convert from NSNumber to NSString
|
|
|
|
- (id)transformedValue:(id)value {
|
2013-10-11 12:03:55 +00:00
|
|
|
DLog(@"VALUE: %@", value);
|
2022-02-07 05:49:27 +00:00
|
|
|
if(value == nil) return nil;
|
2008-03-09 02:53:13 +00:00
|
|
|
BOOL queued = [value boolValue];
|
2022-02-07 05:49:27 +00:00
|
|
|
|
|
|
|
if(queued) {
|
2008-03-08 23:58:52 +00:00
|
|
|
return @"Remove from Queue";
|
2022-02-07 05:49:27 +00:00
|
|
|
} else {
|
2008-03-09 02:53:13 +00:00
|
|
|
return @"Add to Queue";
|
|
|
|
}
|
2008-03-08 23:58:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|