您的位置:首页 > Web前端 > React

通过Reactivecocoa绑定UISwitch到NSUserDefault

2016-03-31 12:33 671 查看
RACChannelTerminal *switchTerminal = self.someSwitch.rac_newOnChannel;
RACChannelTerminal *defaultsTerminal = [[NSUserDefaults standardUserDefaults] rac_channelTerminalForKey:@"someBoolKey"];

[switchTerminal subscribe:defaultsTerminal];
[defaultsTerminal subscribe:switchTerminal];

参考:

http://stackoverflow.com/questions/23107136/bind-uiswitchs-state-to-nsuserdefaults-with-reactivecocoa
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: