Questions tagged [dispatch-queue]

231 questions
0
votes
1 answer

Will a Serial DispatchQueue wait if a task spawns a different thread

Serial dispatch queues will execute their tasks one at a time. But what if I have task1 and task2 in the queue. task1 one starts execution and calls a function with a completion block (which I assume will use a different thread to execute). At…
JeffP
  • 187
  • 1
  • 7
0
votes
1 answer

Dispatch for loading UIImages producing unexpected results

I am building an app that has several images(Plans) that are loaded and setup on a scrollview with a page content. I am trying to load the first image on the main thread and then load the surrounding images from it's index on a background thread.…
Dane Caro
  • 75
  • 1
  • 7
0
votes
0 answers

Are there any existing mechanisms in the swift language for cascading function calls through closures within a single queue?

I have a task to call functions with a certain order synchronously with respect to each other. I realized my function, but for some reason when I checked it, I found an anomaly. Let's say if you make a list of calls to resolve which rights and when…
0
votes
1 answer

When updating my UI in response to an async action, where should I call DispatchQueue?

In my iOS app, I make a lot of web requests. When these requests succeed / fail, a delegate method in the view controller is triggered. The delegate method contains code that is responsible for updating the UI. In the following examples…
0
votes
1 answer

how to monitor when tasks of dispatch queue in recursion all completed?

Normally I can use DispatchGroup to track the tasks in multiple Dispatch task. But in order to make sure DispatchGroup works properly, the group.notify method has to be called after all of the group.enter are called for all the tasks. The questions…
0
votes
1 answer

How can I use DispatchGroup to look up photos and store in UIImage array

I have looked at quite a few examples of using dispatch group but I can't seem to get it to work. I am using Google Maps for my project, and have placed markers at nearby businesses. When a marker is clicked, I want to show another view controller…
Sishir Mohan
  • 59
  • 1
  • 4
0
votes
0 answers

Can't resolve "NIL" value (DispatchQueue, VNCoreMLRequest)

I'm trying to update a class variable (prediction) and then use that variable as data for a segue (AnalyzeSegue). However even if I update the class variable within the function (detectScene), the class variable is a nil value during prepare for…
Moondra
  • 4,399
  • 9
  • 46
  • 104
0
votes
2 answers

What is difference between Dispatch Queue Priority and QoS in Dispatch Queue?

is there any difference between DISPATCH_QUEUE_PRIORITY_HIGH and user-interactive for QoS in Dispatch Queue?
nuttekar
  • 25
  • 6
0
votes
2 answers

Swift - How do i return the array value outside of the closure?

Im having a problem with my swift code. I am trying to set the array yearsLinks to a value inside my closure and I am able to do this and print it while I am still in the closure but when i try to print the array values outside of the closure, it…
Danesh
  • 61
  • 1
  • 7
0
votes
2 answers

iOS Swift Call Function Only When Particular ViewController Is In Foreground

In my app I am having two view controller viewcontroller1 and viewcontroller2. In view controller1 I am having one function called UpdateView() I need to call this function for every 60 seconds and I did it using…
Kavin Kumar Arumugam
  • 1,792
  • 3
  • 28
  • 47
0
votes
2 answers

Delay in DispatchQueue.main.async

I have a design like below flow. I need to set delay between 5th and 6th steps for 0.3second. I tried below options but couldn't get any result. My question is, how can I achieve this? Note: 13seconds for see the animation. Flow Task Handler // for…
Utku
  • 145
  • 1
  • 13
0
votes
1 answer

Synchronous processing with DispatchQueue in Swift

I have a method which does processing for the events I receive from the server. The method can be called from multiple places in different classes. I want to synchronize the processing of the events using DispatchQueue/Serial Queue to discard the…
hacker_1989
  • 303
  • 4
  • 15
0
votes
1 answer

Is running code on DispatchQueue.main.async slower?

When creating a label that uses data from an API within a closure that returns data from that api: APIData().getRequest(epicGamesUsername: "test") { (output) in DispatchQueue.main.async { let winsLabelForProfile =…
Julian L
  • 84
  • 1
  • 3
  • 10
0
votes
2 answers

Run tasks asynchronously/concurrently/parallally in iOS swift

How can i executes all the above taks at one time for improving speed. self.passingMsgIdsTofetchMsgss(messageIDs : msgIDBatches[0]) self.passingMsgIdsTofetchMsgss(messageIDs : msgIDBatches[1]) self.passingMsgIdsTofetchMsgss(messageIDs :…
user9364391
0
votes
1 answer

textfield extension is not updating text on screen (swfit4)

The extension code below updates the the text but does not update the last letter. So if the word she is type in the textfield the text on the screen only shows sh. extension ViewController: UITextFieldDelegate{ func textField(_ textField:…
user8105388