mirror of
https://github.com/oonyeje/Get-Hip.git
synced 2025-12-25 03:37:40 +00:00
39 lines
580 B
Objective-C
Executable File
39 lines
580 B
Objective-C
Executable File
//
|
|
// NSMutableArray+QueueMethods.m
|
|
// TDAudioPlayer
|
|
//
|
|
// Created by Tony DiPasquale on 11/12/13.
|
|
// Copyright (c) 2013 Tony DiPasquale. The MIT License (MIT).
|
|
//
|
|
|
|
#import "NSMutableArray+QueueMethods.h"
|
|
|
|
@implementation NSMutableArray (QueueMethods)
|
|
|
|
- (void)pushObject:(id)object
|
|
{
|
|
[self addObject:object];
|
|
}
|
|
|
|
- (id)popObject
|
|
{
|
|
if (self.count > 0) {
|
|
id object = self[0];
|
|
[self removeObjectAtIndex:0];
|
|
return object;
|
|
}
|
|
|
|
return nil;
|
|
}
|
|
|
|
- (id)topObject
|
|
{
|
|
if (self.count > 0) {
|
|
return self[0];
|
|
}
|
|
|
|
return nil;
|
|
}
|
|
|
|
@end
|