CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.

BijectiveDictionary 1.0.5

BijectiveDictionary 1.0.5

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Mar 2016

Maintained by Peter Meyers.



  • By
  • Peter Meyers and Zach Langley

A dictionary that preserves the uniqueness of both its keys and its values.

Use BijectiveDictionary when you want to:

  • enforce that both keys and values are unique.
  • find a value by key in O(1) time.
  • find a key by value in O(1) time.
  • retrieve the inverse in O(1) time.

BijectiveDictionary implements six classes to provide ordering, mutability and thread-safety.

  • OPCBijectiveDictionary
  • OPCMutableBijectiveDictionary
  • OPCOrderedBijectiveDictionary
  • OPCMutableOrderedBijectiveDictionary
  • OPCThreadSafeMutableBijectiveDictionary
  • OPCThreadSafeMutableOrderedBijectiveDictionary

Sample Usage

OPCMutableBijectiveDictionary *dict = [OPCMutableBijectiveDictionary dictionary];

// Add a new key-value pair.
dict[@"key"] = @"value";

// Retrieve the value for @"key".
NSString *value = dict[@"key"];

// Retrieve the key for @"value".
NSString *key = dict.inverse[@"value"];

Requirements

Minimum iOS Target: 5.0

Installation

BijectiveDictionary is available through CocoaPods. To install, add the following line to your Podfile and then run pod install.

pod 'BijectiveDictionary'

Authors

License

BijectiveDictionary is available under the MIT license. See the LICENSE file for more info.