![
こちらのコードをほぼ丸パクリしてLineDraw.swiftを作成しましたが、
Method does not override any method from its superclass
とエラーが出てしまいました。
解決策を教えていただけるとありがたいです。
import
1 2class LineDraw: UIView { 3 4 override func draw(rect: CGRect) { 5 6 // 三角形 ------------------------------------- 7 // UIBezierPath のインスタンス生成 8 let line = UIBezierPath(); 9 // 起点 10 line.moveToPoint(CGPoint(x: 450, y: 60)); 11 // 帰着点 12 line.addLineToPoint(CGPoint(x: 400, y: 300)); 13 line.addLineToPoint(CGPoint(x: 600, y: 280)); 14 // ラインを結ぶ 15 line.closePath() 16 // 色の設定 17 UIColor.redColor() 18 // ライン幅 19 line.lineWidth = 4 20 // 描画 21 line.stroke(); 22 } 23 } 24
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。