gpt4 book ai didi

swift - 如何以编程方式快速为 UIButton 分配自定义类

转载 作者:搜寻专家 更新时间:2023-11-01 06:35:48 25 4
gpt4 key购买 nike

我创建了一个系统类型的 UIButton

let systemButton = UIButton(type: .system)

我有一个 UIButton 的子类,名为 SSRadioButton

enter image description here我不想在 IB 中做这件事,而是想以编程方式做。欢迎提出所有建议。

最佳答案

代替

let systemButton = UIButton(type: .system)

使用,

let systemButton = SSRadioButton()

并进行进一步的事件。

关于swift - 如何以编程方式快速为 UIButton 分配自定义类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41806685/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com