iOS7 UISwitch 它的事件 ValueChanged:不断调用是这个错误还是什么..? [英] iOS7 UISwitch its Event ValueChanged: Calling continuously is this Bug or what..?

查看:11
本文介绍了iOS7 UISwitch 它的事件 ValueChanged:不断调用是这个错误还是什么..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑

现在已在

来自 XIB 添加 UISwitch

解决方案

我有很多用户面临同样的问题,所以这可能是 UISwitch 的错误,所以我现在才找到临时解决方案.我发现了一个 gitHub 自定义 KLSwitch 现在使用它希望苹果会在 xCode 的下一次更新中解决这个问题:-

https://github.com/KieranLafferty/KLSwitch

Edit

It's now fixed on
Don't do any tweak to fix it.

Edit2

Apparently the same problem happens again in iOS 8.0 and 8.1

Edit3

It's now fixed on
Don't do any tweak to fix it.


Hi Today i seen in UISwitch's Event ValueChanged: Calling continuously while i am change to On to Off or Off to On and my finger moved still on right side as well as left side. I atteched GIF image for more clear with NSLog.

My Value Changed Method is:

- (IBAction)changeSwitch:(id)sender{

    if([sender isOn]){
        NSLog(@"Switch is ON");
    } else{
        NSLog(@"Switch is OFF");
    }
    
}

iOS6 the same code of Switch working Fine as we expectation:

so can anyone suggest me that call only one time its state On or off. or is this is a bug or what..?

UPDATE

Here it is my Demo of it:

programmatic Add UISwitch

from XIB adding UISwitch

解决方案

I got many user that facing same issue so may be this is bug of UISwitch so i found just now for temporary solution of it. I Found one gitHub custom KLSwitch use this for now hope apple will fix this in next update of xCode:-

https://github.com/KieranLafferty/KLSwitch

这篇关于iOS7 UISwitch 它的事件 ValueChanged:不断调用是这个错误还是什么..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆