简体   繁体   English

如何设置不带调用方法的UISegmentedControl

[英]How to set UISegmentedControl w/o calling method

I have a UISegmentedController to allow a user to choose which order they want slides in my app to show up. 我有一个UISegmentedController,允许用户选择他们想要在我的应用程序中显示幻灯片的顺序。 Im wondering if anyone knows of a method to set it other than value did change. 我想知道是否有人知道设置值以外的方法的确发生了变化。 I have other methods that keep getting triggered in viewDidLoad while its being set to their previously selected index. 我还有其他方法在将viewDidLoad设置为之前选择的索引时不断被触发。 I don't want the other methods triggered until a user changes it. 我不希望在用户更改其他方法之前触发其他方法。 Any suggestions? 有什么建议么?

Thanks in advance 提前致谢

The simplest way would be adding boolean to your class, eg canTrigger. 最简单的方法是将布尔值添加到类中,例如canTrigger。 And you can set it to YES, once user changes. 用户更改后,您可以将其设置为“是”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM