如何设置 UISegmentedControl 不调用方法
我有一个 UISegmentedController 允许用户选择他们希望幻灯片在我的应用程序中显示的顺序。我想知道除了值确实改变之外是否有人知道设置它的方法。我还有其他方法在 viewDidLoad 被设置为之前选择的索引时不断被触发。我不希望在用户更改之前触发其他方法。有什么建议吗?
提前致谢
I have a UISegmentedController to allow a user to choose which order they want slides in my app to show up. 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. I don't want the other methods triggered until a user changes it. Any suggestions?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的方法是将布尔值添加到您的类中,例如 canTrigger。一旦用户更改,您可以将其设置为 YES。
The simplest way would be adding boolean to your class, e.g. canTrigger. And you can set it to YES, once user changes.