diff --git a/Classes/Compatibility/NSArray+Subscripting.h b/Classes/Compatibility/NSArray+Subscripting.h deleted file mode 100644 index 18ba964..0000000 --- a/Classes/Compatibility/NSArray+Subscripting.h +++ /dev/null @@ -1,9 +0,0 @@ -// -// NSArray+Subscripting.h -// Subler -// - -#include - -@interface NSArray (Subscripting) -@end diff --git a/Classes/Compatibility/NSArray+Subscripting.m b/Classes/Compatibility/NSArray+Subscripting.m deleted file mode 100644 index 1046b04..0000000 --- a/Classes/Compatibility/NSArray+Subscripting.m +++ /dev/null @@ -1,28 +0,0 @@ -// -// NSArray+Subscripting.m -// Subler -// - -#import "NSArray+Subscripting.h" -#import - -@implementation NSArray (Subscripting) - -+ (void)load -{ - Class class = [self class]; - SEL swizzledSelector = @selector(dg_objectAtIndexedSubscript:); - Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); - - class_addMethod([NSArray class], - @selector(objectAtIndexedSubscript:), - method_getImplementation(swizzledMethod), - method_getTypeEncoding(swizzledMethod) - ); -} - -- (id)dg_objectAtIndexedSubscript:(NSInteger)index { - return self[index]; -} - -@end diff --git a/Classes/Compatibility/NSDictionary+Subscript.h b/Classes/Compatibility/NSDictionary+Subscript.h deleted file mode 100755 index aed0f85..0000000 --- a/Classes/Compatibility/NSDictionary+Subscript.h +++ /dev/null @@ -1,9 +0,0 @@ -// -// NSDictionary+Subscript.h -// Subler -// - -#import - -@interface NSDictionary (Subscript) -@end diff --git a/Classes/Compatibility/NSDictionary+Subscript.m b/Classes/Compatibility/NSDictionary+Subscript.m deleted file mode 100755 index 170bc45..0000000 --- a/Classes/Compatibility/NSDictionary+Subscript.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// NSDictionary+Subscript.m -// Subler -// - -#import "NSDictionary+Subscript.h" -#import - -@implementation NSDictionary (Subscript) - -+ (void)load { - Class class = [self class]; - SEL swizzledSelector = @selector(dg_objectForKeyedSubscript:); - Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); - - class_addMethod([NSDictionary class], - @selector(objectForKeyedSubscript:), - method_getImplementation(swizzledMethod), - method_getTypeEncoding(swizzledMethod) - ); -} - --(id)dg_objectForKeyedSubscript:(id)key { - return self[key]; -} - -@end diff --git a/Classes/Compatibility/NSMutableArray+Subscript.h b/Classes/Compatibility/NSMutableArray+Subscript.h deleted file mode 100755 index 12c5da2..0000000 --- a/Classes/Compatibility/NSMutableArray+Subscript.h +++ /dev/null @@ -1,9 +0,0 @@ -// -// NSMutableArray+Subscript.h -// Subler -// - -#import - -@interface NSMutableArray (Subscript) -@end diff --git a/Classes/Compatibility/NSMutableArray+Subscript.m b/Classes/Compatibility/NSMutableArray+Subscript.m deleted file mode 100755 index 162c318..0000000 --- a/Classes/Compatibility/NSMutableArray+Subscript.m +++ /dev/null @@ -1,39 +0,0 @@ -// -// NSMutableArray+Subscript.m -// Subler -// - -#import "NSMutableArray+Subscript.h" -#import - -@implementation NSMutableArray (Subscript) - -+ (void)load -{ - Class class = [self class]; - SEL swizzledSelector = @selector(dg_setObject:atIndexedSubscript:); - Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); - - class_addMethod([NSMutableArray class], - @selector(setObject:atIndexedSubscript:), - method_getImplementation(swizzledMethod), - method_getTypeEncoding(swizzledMethod) - ); -} - -- (void)dg_setObject:(id)anObject atIndexedSubscript:(NSUInteger)index { - if (anObject == nil) { - [NSException raise:NSInvalidArgumentException format:@"setObject:atIndexedSubscript does not allow objects to be nil"]; - } - if (index > self.count) { - [NSException raise:NSRangeException format:@"setObject:atIndexedSubscript does not allow the index to be out of array bounds"]; - } - if (index == self.count) { - [self addObject:anObject]; - } - else { - self[index] = anObject; - } -} - -@end diff --git a/Classes/Compatibility/NSMutableDictionary+Subscript.h b/Classes/Compatibility/NSMutableDictionary+Subscript.h deleted file mode 100755 index a07a731..0000000 --- a/Classes/Compatibility/NSMutableDictionary+Subscript.h +++ /dev/null @@ -1,9 +0,0 @@ -// -// NSMutableDictionary+Subscript.h -// Subler -// - -#import - -@interface NSMutableDictionary (Subscript) -@end diff --git a/Classes/Compatibility/NSMutableDictionary+Subscript.m b/Classes/Compatibility/NSMutableDictionary+Subscript.m deleted file mode 100755 index 94545ab..0000000 --- a/Classes/Compatibility/NSMutableDictionary+Subscript.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// NSMutableDictionary+Subscript.m -// Subler -// - -#import "NSMutableDictionary+Subscript.h" -#import - -@implementation NSMutableDictionary (Subscript) - -+ (void)load { - Class class = [self class]; - SEL swizzledSelector = @selector(dg_setObject:forKeyedSubscript:); - Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); - - class_addMethod([NSMutableDictionary class], - @selector(setObject:forKeyedSubscript:), - method_getImplementation(swizzledMethod), - method_getTypeEncoding(swizzledMethod) - ); -} - -- (void)dg_setObject:(id)object forKeyedSubscript:(id < NSCopying >)aKey { - self[aKey] = object; -} - -@end