completionhandler Questions

2

I have a iOS (swift) Application available AppStore since November 2017. I added Firebase Analytics and Crashlytics to proactively see issues which didn't occur during development and testing. I'm...
Luba asked 18/10, 2018 at 17:12

9

Solved

I was just curious as to how I would approach this. If I had a function, and I wanted something to happen when it was fully executed, how would I add this into the function? Thanks
Mortensen asked 22/5, 2015 at 16:13

3

Solved

After years, I'm trying to develop an Android app, using Firebase Firestore. I'm basically trying to replicate this Swift function: func getCategories(onCompletion completionBlock: @escaping (_ ca...

3

Solved

Looking at the documentation for URLSession.dataTask it's clear this function is called asynchronously but there's no mention of whether the completionHandler returns to the main thread, the thread...

3

Solved

I'm using DispatchGroup.enter() and leave() to process a helper class's reverseG async function. Problem is clear, I'm using mainViewController's object to call mainViewControllers's dispatchGroup....

1

Solved

In my project, I came across a situation when I need to use the background queue to create an AVPlayerItem (which I create in setupTrackModels function). I'd like do it in getTracks function, and t...
Wilbur asked 22/10, 2020 at 12:6

8

Solved

In my UIActivityViewController, I use completion handler to execute a "successfully shared" notification. It works but my only problem is, it still shows the notification if the user presses cancel...
Arta asked 28/2, 2014 at 0:42

3

Solved

I have this same question as was asked and answered here: How to get data to return from NSURLSessionDataTask The difference: How can I do this in Swift? I do not know Objective C at all so trying...
Kissable asked 7/11, 2014 at 5:29

1

Solved

I am attempting to open an app in one of two ways: If the user has no UserDefaults saved, then open up a WelcomeViewController If the user has UserDefaults saved, then open up a MenuContainerView...
Norrisnorrv asked 13/11, 2019 at 20:45

3

Solved

I am trying to call a swift method, which is implemented like this:- @objc class DataAPI: NSObject { func makeGet(place:NSString , completionHandler: (String! , Bool!) -> Void) { var str:Str...
Sacrilegious asked 17/8, 2016 at 9:54

4

I am messed with both completion handler and blocks while I am using them in Swift and Objective-C. And when I am searching blocks in Swift on google it is showing result for completion handler! Ca...
Nuncio asked 21/9, 2016 at 7:11

1

I am trying to handle "google sign in" in singleton helper class. I have LoginHelper, and a method which handles logins with completion handler. As you know Google Sign have delegate methods. When...
Sclerite asked 28/4, 2018 at 18:54

0

I am still quite new to iOS development and I am trying to teach myself good coding practices and design patterns in Swift starting with MVVM. I need to pass the data from a completion handle in my...
Prevaricator asked 28/4, 2018 at 6:2

2

Solved

I'm trying to coordinate several completion handlers for each element in an array. The code is essentially this: var results = [String:Int]() func requestData(for identifiers: [String]) { iden...
Vicenta asked 20/11, 2017 at 2:14

4

Solved

I am trying to check if UserNotifications are enabled and if not I want to throw an alert. So I have a function checkAvailability which checks multiple things, including the UserNotification author...
Beaubeauchamp asked 15/2, 2017 at 16:52

2

Solved

I have following function to download JSON data in my SeachVC (UIViewController) which works perfect. func downloadJSON(){ guard let url = URL(string: "myURL") else { return } URLSession.share...
Tortuosity asked 31/10, 2017 at 21:48

1

Solved

I'm sorry if this question has been asked previously, I really couldn't find anything even similar! I'm also sorry if the question is dumb, I'm an iOS Developer and I'm a bit lost here in Android.....

3

I have the following function where I have completion handler but I'm getting this error: Closure use of non-escaping parameter may allow it to escape Here is my code: func makeRequestcompletio...
Tangerine asked 13/2, 2017 at 22:38

2

Solved

I have a series of nested completion blocks in the code provided below. This is because I need to make separate network requests in the background to abstract data to be used in the next method, wh...
Glacis asked 1/6, 2017 at 7:42

3

Solved

I am wondering how to do the following correctly: I have a method that is to return an NSData object. It gets the NSData object from a UIDocument. The NSData object can get large, so I want to make...
Icarus asked 8/3, 2014 at 10:4

2

Solved

I am trying to fetch data from two different Firebase tables. Here is the structure of table: Post { 1{ pImages{ i1:true i2:true } } 2{ pImages{ i3:true } } } Images{ i1{ iUrl : .......
Newscast asked 10/7, 2016 at 2:55

2

Solved

working on some FirAuth things, but for some reason I can't figure out how to check if the users proposed email address has already been taken. I've tried calling .fetchProvidersForEmail as suggest...
Scarberry asked 30/7, 2016 at 17:43

2

I have a function performSync which runs through an array and for each item in this array, I am calling a function which in itself contains an async alamofire request. I need to be able to tell whe...
Introduction asked 1/2, 2017 at 11:6

2

Solved

I've tried to troubleshoot this warning but have had no success. Since upgrading to swift3, I am receiving a warning message in my Facebook Graph Request completion handler. The error message is ...
Rimskykorsakov asked 26/9, 2016 at 21:4

5

Solved

It seems that for some reason Swift have chosen to make coding in it less readable by forcing users to remove completion handler parameter labels. I have read the Swift discussion and still think i...
Janie asked 21/9, 2016 at 9:56

© 2022 - 2024 — McMap. All rights reserved.