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
}
*/
}