回答編集履歴
1
sample
answer
CHANGED
@@ -1,1 +1,27 @@
|
|
1
|
-
`.isIndeterminate = false`にして下さい。
|
1
|
+
`.isIndeterminate = false`にして下さい。
|
2
|
+
|
3
|
+
# sample
|
4
|
+
|
5
|
+
```swift
|
6
|
+
let count = 10
|
7
|
+
|
8
|
+
self.progressBar.minValue = 0
|
9
|
+
self.progressBar.maxValue = Double(count)
|
10
|
+
self.progressBar.doubleValue = 0
|
11
|
+
self.progressBar.isIndeterminate = false
|
12
|
+
|
13
|
+
DispatchQueue.global().async {
|
14
|
+
for n in 0..<count {
|
15
|
+
|
16
|
+
//保存処理の代わり
|
17
|
+
print(n)
|
18
|
+
Thread.sleep(forTimeInterval: 1)
|
19
|
+
|
20
|
+
DispatchQueue.main.async {
|
21
|
+
print("+", n)
|
22
|
+
self.progressBar.doubleValue += 1
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
print("finished")
|
27
|
+
```
|