RACChannelTerminal *switchTerminal = self.someSwitchrac_newOnChannel; defaultsTerminal [[NSUserDefaults standardUserDefaults] rac_channelTerminalForKey:@"someBoolKey"];[switchTerminal subscribe:defaultsTerminaldefaultsTerminal subscribeswitchTerminal];
参考:
http://stackoverflow.com/questions/23107136/bind-uiswitchs-state-to-nsuserdefaults-with-reactivecocoa
原文链接:https://www.f2er.com/react/306974.html