{"action":"created","issue":{"url":"https://api.github.com/repos/RACCommunity/Rex/issues/115","repository_url":"https://api.github.com/repos/RACCommunity/Rex","labels_url":"https://api.github.com/repos/RACCommunity/Rex/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/RACCommunity/Rex/issues/115/comments","events_url":"https://api.github.com/repos/RACCommunity/Rex/issues/115/events","html_url":"https://github.com/RACCommunity/Rex/pull/115","id":150498881,"number":115,"title":"Add rex_valueChanged to UISwitch","user":{"login":"dmcrodrigues","id":1098602,"avatar_url":"https://avatars.githubusercontent.com/u/1098602?v=3","gravatar_id":"","url":"https://api.github.com/users/dmcrodrigues","html_url":"https://github.com/dmcrodrigues","followers_url":"https://api.github.com/users/dmcrodrigues/followers","following_url":"https://api.github.com/users/dmcrodrigues/following{/other_user}","gists_url":"https://api.github.com/users/dmcrodrigues/gists{/gist_id}","starred_url":"https://api.github.com/users/dmcrodrigues/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmcrodrigues/subscriptions","organizations_url":"https://api.github.com/users/dmcrodrigues/orgs","repos_url":"https://api.github.com/users/dmcrodrigues/repos","events_url":"https://api.github.com/users/dmcrodrigues/events{/privacy}","received_events_url":"https://api.github.com/users/dmcrodrigues/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-04-23T00:13:34Z","updated_at":"2016-07-06T09:44:08Z","closed_at":"2016-07-06T09:44:07Z","pull_request":{"url":"https://api.github.com/repos/RACCommunity/Rex/pulls/115","html_url":"https://github.com/RACCommunity/Rex/pull/115","diff_url":"https://github.com/RACCommunity/Rex/pull/115.diff","patch_url":"https://github.com/RACCommunity/Rex/pull/115.patch"},"body":"## Motivation\r\n\r\nI've used a few switches in the last days and I found very useful establishing an action to act immediately upon the change of the switch but also controlling the enabled state automatically.\r\n\r\n## Description\r\nI created this new property highly inspired in the implementation of `rex_pressed` and everything worked as expected. However, there's an issue since iOS 7 where a switch can trigger multiple notifications of value changed even when there's not a change of switch's state, [rdar://14485185](https://openradar.appspot.com/14485185). I changed the implementation a bit to adopt internal observation of changes and trigger the action manually only when there's in fact a change to achieve the originally expected behaviour.\r\n\r\nI'm not happy with this but the issue is real and undesirable so I decided to contribute it because probably this may be useful to others facing this particular problem.\r\n\r\nIn case of positive feedback, I'll try to invest some time in a way to test it since apparently we cannot manually trigger `.ValueChanged` events for controls beyond `UIButton`."},"comment":{"url":"https://api.github.com/repos/RACCommunity/Rex/issues/comments/230726612","html_url":"https://github.com/RACCommunity/Rex/pull/115#issuecomment-230726612","issue_url":"https://api.github.com/repos/RACCommunity/Rex/issues/115","id":230726612,"user":{"login":"dmcrodrigues","id":1098602,"avatar_url":"https://avatars.githubusercontent.com/u/1098602?v=3","gravatar_id":"","url":"https://api.github.com/users/dmcrodrigues","html_url":"https://github.com/dmcrodrigues","followers_url":"https://api.github.com/users/dmcrodrigues/followers","following_url":"https://api.github.com/users/dmcrodrigues/following{/other_user}","gists_url":"https://api.github.com/users/dmcrodrigues/gists{/gist_id}","starred_url":"https://api.github.com/users/dmcrodrigues/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmcrodrigues/subscriptions","organizations_url":"https://api.github.com/users/dmcrodrigues/orgs","repos_url":"https://api.github.com/users/dmcrodrigues/repos","events_url":"https://api.github.com/users/dmcrodrigues/events{/privacy}","received_events_url":"https://api.github.com/users/dmcrodrigues/received_events","type":"User","site_admin":false},"created_at":"2016-07-06T09:44:07Z","updated_at":"2016-07-06T09:44:07Z","body":"I'm not happy with this and I think there might be some problems with it so I'll close this."}}
{"actor":{"display_login":"dmcrodrigues"}}