回答編集履歴
3
訂正
test
CHANGED
@@ -48,4 +48,4 @@
|
|
48
48
|
|
49
49
|
|
50
50
|
|
51
|
-
[
|
51
|
+
[サンプル](https://github.com/tyobigoro/tContainerView)
|
2
追記
test
CHANGED
@@ -37,3 +37,15 @@
|
|
37
37
|
|
38
38
|
|
39
39
|
```
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
---
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
追記
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
[タップでのサンプル](https://github.com/tyobigoro/tContainerView)
|
1
追記
test
CHANGED
@@ -1 +1,39 @@
|
|
1
1
|
親viewのtest(_:)と書けばよいのでは?
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
---
|
6
|
+
|
7
|
+
追記
|
8
|
+
|
9
|
+
```swift
|
10
|
+
|
11
|
+
let hugaView = UIView()
|
12
|
+
|
13
|
+
// 諸々設定
|
14
|
+
|
15
|
+
let gesture = UILongPressGestureRecognizer(target: self.parent as? HogeVC, action: #selector((self.parent as? HogeVC)?.test()))
|
16
|
+
|
17
|
+
gesture.delegate = self
|
18
|
+
|
19
|
+
hugaView.addGestureRecognizer(gesture)
|
20
|
+
|
21
|
+
self.parent?.view.addSubview(hugaView)
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
class HogeVC: UIViewController {
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
@objc func test() {
|
30
|
+
|
31
|
+
}
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
}
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
```
|