回答編集履歴
1
途中送信したのを補完
test
CHANGED
@@ -21,3 +21,65 @@
|
|
21
21
|
+ goodView?.selectimages = LikeImage
|
22
22
|
|
23
23
|
```
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
遷移元はUIImageの配列を受け取る
|
28
|
+
|
29
|
+
```diff
|
30
|
+
|
31
|
+
- var selectimages = UIImage()
|
32
|
+
|
33
|
+
+ var selectimages = [UIImage]()
|
34
|
+
|
35
|
+
```
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
渡された画像の数だけ表示する
|
40
|
+
|
41
|
+
```diff
|
42
|
+
|
43
|
+
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
44
|
+
|
45
|
+
- return 10
|
46
|
+
|
47
|
+
+ return selectimages.count
|
48
|
+
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
func numberOfSections(in tableView: UITableView) -> Int {
|
54
|
+
|
55
|
+
return 1
|
56
|
+
|
57
|
+
}
|
58
|
+
|
59
|
+
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
60
|
+
|
61
|
+
return 390
|
62
|
+
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
68
|
+
|
69
|
+
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
let imageView = cell.contentView.viewWithTag(1) as! UIImageView
|
74
|
+
|
75
|
+
- imageView.image = selectimages
|
76
|
+
|
77
|
+
+ imageView.image = selectimages[indexPath.row]
|
78
|
+
|
79
|
+
return cell
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
```
|