All Questions
Tagged with asynchronous swift
11 questions
2
votes
1
answer
213
views
Using Swift Combine's .map function with external variables
I have a motionManager class which uses CMMotionManager() to send rotationRate and attitude values to a publisher in the form of a MotionValueModel.
...
3
votes
2
answers
1k
views
Blocking call to an async function
While migrating to structured concurrency it may be sometimes convenient to temporarily make a blocking call to an async function - e.g.:
...
2
votes
0
answers
286
views
Fixed-width non-FIFO DispatchQueue
I have implemented a custom concurrent queue on top of GCD which offers two additional pieces of functionality:
Limit the maximum number of concurrently executing tasks.
Give manual control over ...
4
votes
0
answers
861
views
Update UI once all API calls are done
I'm learning Swift at the moment but I would like to produce well-organised code. The goal of my little app is to display the weather of my current location.
I use :
the API of Darksky : https://...
3
votes
1
answer
348
views
Fetch nearby chat users using Firebase and nested completion handlers
I have a method that calls three functions that each make a request to Firebase and pass back data in a completion handler. Once the data from 2 of the completion handlers is sent back, I call another ...
2
votes
2
answers
1k
views
Property value from an asynchronous operation
I have an app which has a session mechanism. When a user creates an account in the app initially, the API returns an access token, the expiry date of that access token and a refresh token which can be ...
3
votes
1
answer
1k
views
XCTestCase#waitFalseExpectationUntilTimeout implementation
I am working on an iOS project and I'm in charge of testing most parts of it. As I write some tests, I often have the need to wait for an asynchronous method to finish, and then test that something ...
2
votes
1
answer
265
views
Loading images in the background for a table view
I have fetchData method which fills my imagesArray:
...
5
votes
1
answer
384
views
Using Grand Central Dispatch to fetch data from Parse.com and update UI asynchronously
This works, and the UI is snappy in the simulator, but since this is my first time really using GCD, I'd just like this code to be reviewed before I start using it everywhere. Note that this is ...
6
votes
2
answers
752
views
Asynchronous HTTP JSON request
For asynchronous requests, I use Alamofire.
I have created one method for requesting async data.
...
9
votes
1
answer
2k
views
Asynchronous Array.map
I put together an asynchronous map function for Swift's Array using Grand Central Dispatch. It's called with a transform closure,...