我正在尝试为我正在为 iOS8 使用的键盘创建自己的自定义视图类,当我创建一个扩展的新类时,我在加载键盘时UIView
崩溃并出现错误。Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP,subcode=0x0)
该错误显示在该行上class KeyButton: UIView {
,我正在努力进一步调试。我最初试图扩展UIButton
,但没有奏效,所以我将其更改为UIView
没有进一步的运气。
我知道 Swift/iOS8 会有一些初期问题,但希望这是可以修复的!
编辑
完整类代码:
import UIKit
class KeyButton: UIView { /* This is where the app crashes, apparently */
init(frame: CGRect) {
super.init(frame: frame)
// Initialization code
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func drawRect(rect: CGRect)
{
// Drawing code
}
*/
}