PINCacheObjectSubscripting.h 809 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // PINCacheObjectSubscripting.h
  3. // PINCache
  4. //
  5. // Created by Rocir Marcos Leite Santiago on 4/2/16.
  6. // Copyright © 2016 Pinterest. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @protocol PINCacheObjectSubscripting <NSObject>
  10. @required
  11. /**
  12. This method enables using literals on the receiving object, such as `id object = cache[@"key"];`.
  13. @param key The key associated with the object.
  14. @result The object for the specified key.
  15. */
  16. - (id)objectForKeyedSubscript:(NSString *)key;
  17. /**
  18. This method enables using literals on the receiving object, such as `cache[@"key"] = object;`.
  19. @param object An object to be assigned for the key.
  20. @param key A key to associate with the object. This string will be copied.
  21. */
  22. - (void)setObject:(id)obj forKeyedSubscript:(NSString *)key;
  23. @end