Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func queuing() {
- var concurrentQueue = DispatchQueue(label: "test",attributes: .concurrent)
- var myGroup = DispatchGroup()
- var mySecondGroup = DispatchGroup()
- myGroup.enter()
- mySecondGroup.enter()
- concurrentQueue.async {
- for i in 0...5 {
- print(i)
- if (i==5) {
- myGroup.leave()
- }
- }
- }
- myGroup.notify(queue: DispatchQueue.main) {
- print("Initial Json request with List of URLs completed")
- concurrentQueue.async {
- for i in 10...15 {
- print(i)
- if (i==15){
- mySecondGroup.leave()
- }
- }
- }
- }
- mySecondGroup.notify(queue: DispatchQueue.main) {
- print("All Images download complete")
- }
- }
- queuing()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement