Latest 0.0.1
Homepage https://github.com/ocgungor/OCGQueue
License Apache
Platforms osx , ios , tvos , watchos , requires ARC

A simple Queue implementation using NSMutableArray

Homemade Queue implementation using NSMutableArray in Objective-C.
Based on https://en.wikipedia.org/wiki/Queue_(abstract_data_type)

Installation

    pod 'OCGQueue'

Usage

Init

OCGQueue *queue = [OCGQueue queueWithObjects:@"ocg", @"booka", nil];

    OR

OCGQueue *queue = [[OCGQueue alloc] init];

Add objects to your queue

[queue pushObject:@"hello world"];

Retrieve your object at the beginning of your queue without removing it

[queue peekObject];

Retrieve your object at the beginning of your queue

[queue popObject];

Swap the two objects at the beginning of your queue

[queue popObject];

Check if your queue is empty

queue.isEmpty;

Latest podspec

{
    "name": "OCGQueue",
    "version": "0.0.1",
    "summary": "A simple Queue implementation using NSMutableArray",
    "description": "Homemade Queue implementation using NSMutableArray in Objective-C.",
    "homepage": "https://github.com/ocgungor/OCGQueue",
    "license": {
        "type": "Apache",
        "file": "LICENSE"
    },
    "authors": "Oguzhan Gungor",
    "source": {
        "git": "https://github.com/ocgungor/OCGQueue.git",
        "tag": "0.0.1"
    },
    "source_files": [
        "Classes",
        "OCGQueue/Classes/**/*.{h,m}"
    ],
    "exclude_files": "Classes/Exclude",
    "requires_arc": true,
    "platforms": {
        "osx": null,
        "ios": null,
        "tvos": null,
        "watchos": null
    }
}

Pin It on Pinterest

Share This