NSUserDefaults+RACSupport.h 817 B

12345678910111213141516171819202122232425262728
  1. //
  2. // NSUserDefaults+RACSupport.h
  3. // ReactiveCocoa
  4. //
  5. // Created by Matt Diephouse on 12/19/13.
  6. // Copyright (c) 2013 GitHub, Inc. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @class RACChannelTerminal;
  10. @interface NSUserDefaults (RACSupport)
  11. /// Creates and returns a terminal for binding the user defaults key.
  12. ///
  13. /// **Note:** The value in the user defaults is *asynchronously* updated with
  14. /// values sent to the channel.
  15. ///
  16. /// key - The user defaults key to create the channel terminal for.
  17. ///
  18. /// Returns a channel terminal that sends the value of the user defaults key
  19. /// upon subscription, sends an updated value whenever the default changes, and
  20. /// updates the default asynchronously with values it receives.
  21. - (RACChannelTerminal *)rac_channelTerminalForKey:(NSString *)key;
  22. @end