回答編集履歴
2
コードを追加
test
CHANGED
@@ -6,13 +6,13 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
if (!self.isLoading && scrollView.contentOffset.y >= tableView.contentSize.height - self.tableView.bounds.size.height) {
|
9
|
+
if (!self.isLoading && scrollView.contentOffset.y >= tableView.contentSize.height - self.tableView.bounds.size.height) {
|
10
10
|
|
11
|
-
self.isLoading = true
|
11
|
+
self.isLoading = true
|
12
12
|
|
13
|
-
callAPI(apiurl: "hoge.com/api/data/")
|
13
|
+
callAPI(apiurl: "hoge.com/api/data/")
|
14
14
|
|
15
|
-
}
|
15
|
+
}
|
16
16
|
|
17
17
|
}
|
18
18
|
|
@@ -20,4 +20,28 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
+
```Swift
|
24
|
+
|
25
|
+
func callAPI(apiurl: String){
|
26
|
+
|
27
|
+
Alamofire.request(apiurl).responseJSON{(response) in
|
28
|
+
|
29
|
+
...
|
30
|
+
|
23
|
-
|
31
|
+
self.tableView.reloadData()
|
32
|
+
|
33
|
+
self.isLoading = false
|
34
|
+
|
35
|
+
}
|
36
|
+
|
37
|
+
}
|
38
|
+
|
39
|
+
```
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
としてあげればいいのではないでしょうか?
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
1
文法の修正
test
CHANGED
@@ -20,4 +20,4 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
`callAPI()`内`self.tableView.reloadData()`後にフラグを降ろしてあげればいいんじゃないでしょうか?
|
23
|
+
`callAPI()`内で`self.tableView.reloadData()`完了後にフラグを降ろしてあげればいいんじゃないでしょうか?
|