こんにちは。
下記のようなコードでoverride funcの引数frameにCGRectを与えているのですが、この引数にもう一つInt型の引数を追加したいのですが、エラーが出ます。
正しいコードを教えてください。
error
1エラー 2Method does not override any method from its superclass
swift
1//override funcの引数rectにCGRectを与える 2 3class Test: UIView { 4 override func test(_ rect: CGRect) { 5 //(_ rect: CGRect) → (_ rect: CGRect, int: Int)こうしたい。 6 //タプルで引数をつけると "Method does not override any method from its superclass" 7 } 8} 9 10class Tsst: UIView { 11 func tsst(){ 12 let testoo = Test(frame: CGRect(x: 1, y: 1, width: 1, height: 1)) 13 } 14}
回答1件
あなたの回答
tips
プレビュー