Questions tagged [dispatch-queue]

231 questions
0
votes
1 answer

dispatch_queue_t slows down after some time

I have a question about custom DispatchQueue. I created a queue and I use it as a queue for captureOutput: method. Here's a code snippet: //At the file header private let videoQueue = DispatchQueue(label: "videoQueue") //setting queue to…
0
votes
0 answers

Crashed: com.apple.root.utility-qos EXC_BAD_ACCESS KERN_INVALID_ADDRESS

I'm getting following crash. Can't figure out what to look for. Is it related to qos? Crashed: com.apple.root.utility-qos EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000020 Crashed: com.apple.root.utility-qos If it's related to qos then…
Oliver
  • 13
  • 1
  • 6
0
votes
1 answer

NSMutableAttributedString not rendering correctly

I am using a SplitViewController; The master is tableView with a series of RightDetail cells whose Attributed Strings are set via a callback from a value setting popover. The value passed back and set via a method that sets the detailTextLabel of…
eklektek
  • 1,083
  • 1
  • 16
  • 31
0
votes
3 answers

Completion handler called twice (with threading)

I'm currently testing this code in the Xcode 10 playground (Swift 5): func one() { let test = "bla" two(test, completion: { (returned) in print(returned) }) } func two(_ test: String, completion: @escaping (_ returned:…
Neph
  • 1,823
  • 2
  • 31
  • 69
0
votes
1 answer

Is there a specific way to append DispatchWorkItems to a DispatchQueue instead of re declaring them in code?

I have several Dispatch work items to execute on a queue i don't want to redeclare the codes, i want to pass them to an array or list of DispatchWorkItems and then inject it to a dispatch queue is there any way to achieve this ? func…
0
votes
1 answer

Swift - Dispatch Queues and the U/I running serially

I have a secondary LaunchScreenViewController for an App that has some animation whilst it gathers three types of background data. Everything works but the order in which the DispatchQueues.async are run is random. However if I change them to…
Edward Hasted
  • 3,201
  • 8
  • 30
  • 48
0
votes
2 answers

How should I use DispatchGroup for two url requests?

I am using DispatchGroup for two url requests but didn't get any data. I tried each method separately without DispatchGroup, it works fine. So the problem is that I didn't use DispatchGroup correctly. Please help. let buildingManager = …
Mike
  • 817
  • 1
  • 8
  • 15
0
votes
1 answer

Swift - stopAnimating() - must be used from main thread only

I have a succession of tasks that have to be performed in sequence, so they are corralled by DispatchQueue. To inform the user that they are chugging away I start the activity icon. But how do I stop if off the main thread? Logically what I am…
Edward Hasted
  • 3,201
  • 8
  • 30
  • 48
0
votes
1 answer

UICollisionBehavior and UIGravityBehavior not working as expected with DispatchQueue

I'm currently designing a UI for a framework I've been given that plays connect 4. This framework is encapsulated in a class called GameSession. I will not describe the ins and outs of it's API and how it operates. I don't believe it's important. I…
0
votes
1 answer

Call next function after terminate the previous

I need to call func fillFields after that func getJsonData is over. The func getJsonData is a Async Task for get data on server for URLRequest. func getAPIData() { let initial = URL(string: "http://10.0.0.2/Blower/app/api/inicial.php") …
Donadon
  • 113
  • 11
0
votes
0 answers

How to call the web service simultaneously without waiting for a response swift ios?

We have to send the captured image simultaneously in a background thread. we have used this DispatchQueue to call below API. @IBAction func gallery(_ sender: Any) { func upload(imageData: Data,fileName: String,completion:@escaping (_…
HariKarthick
  • 1,369
  • 1
  • 19
  • 47
0
votes
0 answers

How does dispatch queue and dispatch group work?

I am new to objective-c, currently I am writing code that downloads a file from server and then do some operation to the downloaded file. I am confused about dispatch queue and dispatch group. So I have a function called dowanloadZip, inside this…
Anna
  • 443
  • 9
  • 29
0
votes
1 answer

Playground - DispatchQueue.main.asyncAfter not working

I am running the following in Playground, but nothing is getting printed : DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + DispatchTimeInterval.seconds(1)) { print("hiii") }
Nitish
  • 13,845
  • 28
  • 135
  • 263
0
votes
2 answers

Swift - Timer with GCD with condition

I use Firebase to upload a file with a progress indicator: RappleActivityIndicatorView.setProgress(CGFloat(a), textValue: "\(String(a * 100)) %") print("\(a) %") I want to implement a condition : if the value of the % (for eg : 23%) is stuck for 15…
Victor
  • 61
  • 1
  • 13
0
votes
2 answers

iOS (Swift): Making Vibrant Button Flash with DispatchQueue.main.asyncAfter

I'm trying to light up a bunch of vibrant UIButton subclass instances by calling the flash() method given by: func flash(delay: TimeInterval = 0.0) { DispatchQueue.main.asyncAfter(deadline: .now() + delay) { [weak self] in guard let…
ajrlewis
  • 2,968
  • 3
  • 33
  • 67