UISwitch Doesn't Send valueChanged Event When Changed Programmatically

妖精的绣舞 提交于 2019-12-01 17:46:31

This is correct and desired behavior. Since you explicitly changed the value, it is up to you to decide how to handle the changed value.

The reason for this is because it is not uncommon to explicitly change the value of control after being notified of its value being changed through user interaction. If the explicit state change caused the event to fire again, you would end up in an infinite loop.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!