Post

Replies

Boosts

Views

Activity

Comment on Is there an order for response, data, and error in URLSession delegates?
I currently have it as below, so that the completionHandler gets called first and no matter what ` func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: (URLSession.ResponseDisposition) -> Void) { completionHandler(URLSession.ResponseDisposition.allow) if let httpResponse = response as? HTTPURLResponse { xFile?.httpResponse = httpResponse.statusCode DispatchQueue.main.async { [self] in if httpResponse.statusCode != 200 { ...my code } } } }`
Topic: Programming Languages SubTopic: Swift Tags:
May ’22
Comment on Does Swift 5.x offer any callback functions in AVAudioRecorder or must I use a callback timer?
So I need to do my own callback timer, got it. Thanks @MobileTen
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’21
Comment on Is there a way to find gaps, or silences in audio files?
That code appears to read the stream live, still too new at this. Going to have to study it to find out how to read from saved file.
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Jan ’22
Comment on How can I get my app to wait for a permission request to complete?
Sorry, this does not make my app wait. Someone suggested I put the call to the rest of my app as a function in the completion part of AVCaptureDevice.requestAccess. I guess that makes sense. I would have though there was a way to: 1 - create a separate thread/queue 2- Make a call to the thread 3 - Tell calling app to wait till the new thread/queue is done
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’22
Comment on How can I get my app to wait for a permission request to complete?
See code below please
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’22
Comment on What is the difference between func (to view: UIView) and not using the 'to'?
So if I read you correctly? Do whichever I please, there is no difference as far as operations are concerned?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’22
Comment on Would someone please explain the <> in let requestedComponents: Set<Calendar.Component> = [ ...]?
So take make sure I read it correctly, Sets and Array are the same except a Set has no ordering, and each value must be unique? And in the example I gave, Calendar.Component was already defined as a set?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’22
Comment on Can I search for an existing instance of a particular class in Swift?
Runtime
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’22
Comment on Can I search for an existing instance of a particular class in Swift in runtime?
Did most of my work in Windows, that had such a feature, so am looking for an equivalent. But also, there might be a case of searching through multiple instances to find a particular one maybe?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’22
Comment on Not sure why Swift is giving me a "Cannot find 'xFile' in scope" error
Wow! The ‘f’! I kept looking at the ‘x’! Thank you. I seriously think I have a reading disorder sometimes.— SergioDCQ less than a minute ago
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’22
Comment on Am unable to receive HTTP responses with UIViewController set as URLSessionDelegate
Oh you.....I see what you did there. I'm going to start calling what you did "Passive/Aggressive teaching." And I mean that as a compliment. Thank you. — SergioDCQ 40 minutes ago Edit this post  Report post of SergioDCQ
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’22
Comment on Am unable to receive HTTP responses with UIViewController set as URLSessionDelegate
Oh no, I got it as soon as I read the line you made me throw in...perfect teaching method. Was just posting the answer over at StackOverflow, was going to do it here next, but you beat me to it. Thank you again.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’22
Comment on Is there an order for response, data, and error in URLSession delegates?
I currently have it as below, so that the completionHandler gets called first and no matter what ` func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: (URLSession.ResponseDisposition) -> Void) { completionHandler(URLSession.ResponseDisposition.allow) if let httpResponse = response as? HTTPURLResponse { xFile?.httpResponse = httpResponse.statusCode DispatchQueue.main.async { [self] in if httpResponse.statusCode != 200 { ...my code } } } }`
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’22
Comment on Is there an order for response, data, and error in URLSession delegates?
I have to clean them up, because at first I was using the wrong delegate. However, I do need to eventually add download as well. So will have to see which I need and don't at some point
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’22
Comment on Alert action disabling depending on textField input
I find the way Swift handles certain things (i.e. the OP) a little too drawn out. Therefore I doubly appreciate this excellent, well explained answer.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’22
Comment on Where can I call register(_:forCellReuseIdentifier:) if I am not using a UITableViewController?
It was just a simple oversight, because I was trying it out quickly. It’s now in there and cell is no longer an optional.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’22