[英]Custom UIButton Swift 2.0
I am trying to convert my project to Swift 2.0. 我正在尝试将我的项目转换为Swift 2.0。 I have a custom UIButton that is now causing an error when I try to build.
我有一个自定义UIButton,现在在尝试构建时会导致错误。 My code is:
var myButton = MyCustomButton.buttonWihType(.Custom) as UIButton
我的代码是:
var myButton = MyCustomButton.buttonWihType(.Custom) as UIButton
This is working with my project in Swift 1.2 but now does not work. 这适用于我在Swift 1.2中的项目,但现在不起作用。 The button uses a UIButton file to draw it called
MyCustomButton
该按钮使用UIButton文件绘制名为
MyCustomButton
文件
Thanks 谢谢
你有尝试过吗?
var myButton = MyCustomButton(type: .Custom)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.