-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path3B2DC41E-C58D-4FF5-A558-30C17A6CF365.codesnippet
42 lines (41 loc) · 1.42 KB
/
3B2DC41E-C58D-4FF5-A558-30C17A6CF365.codesnippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDECodeSnippetCompletionPrefix</key>
<string>my_dispatchgroup_swift_block</string>
<key>IDECodeSnippetCompletionScopes</key>
<array>
<string>All</string>
</array>
<key>IDECodeSnippetContents</key>
<string>let group = DispatchGroup()
let myQueue = DispatchQueue.global()
myQueue.async(group: group, qos: .default, flags: [], execute: {
for _ in 0...10 {
print("耗时任务一")
}
})
myQueue.async(group: group, qos: .default, flags: [], execute: {
for _ in 0...10 {
print("耗时任务二")
}
})
//执行完上面的两个耗时操作, 回到myQueue队列中执行下一步的任务
group.notify(queue: myQueue) {
print("回到该队列中执行")
}</string>
<key>IDECodeSnippetIdentifier</key>
<string>3B2DC41E-C58D-4FF5-A558-30C17A6CF365</string>
<key>IDECodeSnippetLanguage</key>
<string>Xcode.SourceCodeLanguage.Generic</string>
<key>IDECodeSnippetSummary</key>
<string>dispatch组操作</string>
<key>IDECodeSnippetTitle</key>
<string>my_dispatchgroup_swift_block</string>
<key>IDECodeSnippetUserSnippet</key>
<true/>
<key>IDECodeSnippetVersion</key>
<integer>2</integer>
</dict>
</plist>