UISwitch+RACSignalSupport.m 489 B

1234567891011121314151617181920
  1. //
  2. // UISwitch+RACSignalSupport.m
  3. // ReactiveObjC
  4. //
  5. // Created by Uri Baghin on 20/07/2013.
  6. // Copyright (c) 2013 GitHub, Inc. All rights reserved.
  7. //
  8. #import "UISwitch+RACSignalSupport.h"
  9. #import <ReactiveObjC/RACEXTKeyPathCoding.h>
  10. #import "UIControl+RACSignalSupportPrivate.h"
  11. @implementation UISwitch (RACSignalSupport)
  12. - (RACChannelTerminal *)rac_newOnChannel {
  13. return [self rac_channelForControlEvents:UIControlEventValueChanged key:@keypath(self.on) nilValue:@NO];
  14. }
  15. @end