質問編集履歴
1
コードを回答返信用に修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,27 +30,33 @@
|
|
30
30
|
|
31
31
|
|
32
32
|
|
33
|
+
|
34
|
+
|
33
35
|
override func viewDidLayoutSubviews() {
|
34
36
|
|
35
37
|
super.viewDidLayoutSubviews()
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
-
|
39
|
+
}
|
40
40
|
|
41
41
|
}
|
42
42
|
|
43
43
|
|
44
44
|
|
45
|
-
func addLine() {
|
46
45
|
|
47
|
-
|
48
46
|
|
49
|
-
|
47
|
+
class BaseView:UIView {
|
50
48
|
|
51
|
-
path.move(to: CGPoint(x: self.view.frame.midX, y: self.view.frame.minY))
|
52
49
|
|
50
|
+
|
51
|
+
override func draw(_ rect: CGRect) {
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
let path = UIBezierPath()
|
56
|
+
|
57
|
+
path.move(to: CGPoint(x: rect.midX, y: rect.minY))
|
58
|
+
|
53
|
-
path.addLine(to: CGPoint(x:
|
59
|
+
path.addLine(to: CGPoint(x: rect.midX, y: rect.maxY))
|
54
60
|
|
55
61
|
path.close()
|
56
62
|
|
@@ -60,19 +66,7 @@
|
|
60
66
|
|
61
67
|
path.stroke()
|
62
68
|
|
63
|
-
|
69
|
+
}
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
///error: Method does not override any method from its superclass
|
68
|
-
|
69
|
-
/*override func draw(_ rect: CGRect) {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
self.addLine()
|
74
|
-
|
75
|
-
}*/
|
76
70
|
|
77
71
|
}
|
78
72
|
|