回答編集履歴
1
sample
test
CHANGED
@@ -1 +1,53 @@
|
|
1
1
|
`.isIndeterminate = false`にして下さい。
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
# sample
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
```swift
|
10
|
+
|
11
|
+
let count = 10
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
self.progressBar.minValue = 0
|
16
|
+
|
17
|
+
self.progressBar.maxValue = Double(count)
|
18
|
+
|
19
|
+
self.progressBar.doubleValue = 0
|
20
|
+
|
21
|
+
self.progressBar.isIndeterminate = false
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
DispatchQueue.global().async {
|
26
|
+
|
27
|
+
for n in 0..<count {
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
//保存処理の代わり
|
32
|
+
|
33
|
+
print(n)
|
34
|
+
|
35
|
+
Thread.sleep(forTimeInterval: 1)
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
DispatchQueue.main.async {
|
40
|
+
|
41
|
+
print("+", n)
|
42
|
+
|
43
|
+
self.progressBar.doubleValue += 1
|
44
|
+
|
45
|
+
}
|
46
|
+
|
47
|
+
}
|
48
|
+
|
49
|
+
}
|
50
|
+
|
51
|
+
print("finished")
|
52
|
+
|
53
|
+
```
|